How-to guides
Each guide shows one task with short examples you can run in your browser, the options that change the result, and the things to know before you use it in production. Start with the guide closest to your question.
- How-to guideSorting
Sort arrays in place or into a copy, in ascending or descending order, row by row and on several cores.
- How-to guideTop-k and selection
Find the k largest or smallest values, the median or any position of the sorted order without sorting the whole array.
- How-to guideOrder and ranking
Get the order of an array with argsort, reorder several columns together, compute ranks and sort by several columns.
- How-to guideSearching sorted data
Find where values go in sorted data with searchsorted, put values into buckets with bucketize, and count them with bucket_counts.
- How-to guideKeys with values
Sort keys and their values together, keep equal keys in their original order, or take only the first k pairs.
- How-to guideGroups, merges and sets
Total values per key, number the groups of several key columns, merge sorted lists and compute set operations on sorted arrays.
All guides
- Sort and select
- Shapes of data
- With other libraries
Looking for one call by name? The All operations page lists every operation with a link to its guide, and the Python API reference lists every argument.