Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter and sort fields #324

Merged
merged 8 commits into from
Nov 19, 2024
Merged

Filter and sort fields #324

merged 8 commits into from
Nov 19, 2024

Conversation

FrancescAlted
Copy link
Member

This allows performing data filtering, as well as sorting, in structured NDArrays. For example, given an array sarr with fields 'a', 'b' and 'c', the next:

farr = sarr["b >= c"].sort("c").indices().compute()

puts in farr the indices of the rows that fulfills that values in fields in 'b' are larger than values in 'c' ("b >= c" above), sorted by column 'c'.

farr is in turn an NDArray, so it is compressed; think of it as a compact index for other tasks.
See the new examples/ndarray/filter_sort_fields.py self-contained script.

@FrancescAlted FrancescAlted merged commit c831b53 into main Nov 19, 2024
10 checks passed
@FrancescAlted FrancescAlted deleted the filter-sort-fields branch November 19, 2024 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant