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:

IndexValueIs Last Distinct
0applefalse
1bananafalse
2appletrue
3orangetrue
4bananatrue
Table
0
0
Table

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

column

The 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.

Name 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.