Skip to content

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

2 participants