IsLastDistinctMask / Boolean Layer
Create boolean mask columns marking the last occurrence of each distinct value. Similar to pandas duplicated(keep='last') negated. Returns True only for the last occurrence of each value based on row order.
Common applications:
- Keeping most recent instance of records
- Final state analysis
- Last occurrence detection
- Latest event tracking
- Most recent version retention
Example:
Index | Value | Is Last Distinct |
---|---|---|
0 | apple | false |
1 | banana | false |
2 | apple | true |
3 | orange | true |
4 | banana | true |
Mask
[, ...]List of last distinct checking operations to perform. Each mask creates a new boolean column. Common scenarios:
- Keeping most recent customer records
- Finding final system states
- Identifying latest versions
- Tracking final events in sequences
At least one mask must be specified.
Select
columnThe column to check for last distinct values. Works with any data type. The mask will be a boolean column where:
- True indicates the last occurrence of each value
- False indicates previous occurrences
Useful for identifying final appearances and retaining most recent instances.
AsColumn
nameName for the new column. If not provided, the system generates a unique name. If AsColumn
matches an existing column, the existing column is replaced. The name should follow valid column naming conventions.