filter_topn
Sort a dataset by selected columns and pick the first N rows (or exclude them).
ds_in
dataset
requiredAn input dataset to filter.
ds_out
dataset
requiredA new dataset containing the same columns as the input dataset but only those rows passing the filter condition.
n
integer
requiredHow many of the leading rows to keep after sorting.
sort_by
[array, string]
One or more columns to sort by before picking the first n rows. May be a column name or a list of column names.
- salary
- [‘salary’, ‘time_spend_company’, ‘last_evaluation’]
exclude
boolean
If true
, the first n rows after sorting will be excluded from the resulting dataset.
ascending
boolean
Whether to sort in ascending order rather than descending.
Was this page helpful?