array_ module¶
Utilities for working with arrays.
build_nan_mask function¶
Build a NaN mask out of one to multiple arrays via the OR rule.
cast_to_max_precision function¶
Cast an array to a maximum integer/floating precision.
Argument must be either an integer denoting the number of bits, or one of 'half', 'single', and 'double'.
cast_to_min_precision function¶
Cast an array to a minimum integer/floating precision.
Argument must be either an integer denoting the number of bits, or one of 'half', 'single', and 'double'.
get_ranges_arr function¶
Build array from start and end indices.
Based on https://stackoverflow.com/a/37626057
hash_int_rows_nb function¶
Hash rows in a 2-dim array.
First digits of each hash correspond to the left-most column, the last digits to the right-most column. Thus, the resulting hashes are not suitable for sorting by value.
index_repeating_rows_nb function¶
Index repeating rows using monotonically increasing numbers.
insert_argsort_nb function¶
Perform argsort using insertion sort.
In-memory and without recursion -> very fast for smaller arrays.
int_digit_count_nb function¶
Get the digit count in a number.
is_range function¶
Checks if array is arr range.
is_range_nb function¶
Numba-compiled version of is_range().
is_sorted function¶
Checks if array is sorted.
is_sorted_nb function¶
Numba-compiled version of is_sorted().
max_count_nb function¶
Get the first position, the value, and the count of the array's maximum.
max_rel_rescale function¶
Rescale elements in arr relatively to maximum.
min_count_nb function¶
Get the first position, the value, and the count of the array's minimum.
min_rel_rescale function¶
Rescale elements in arr relatively to minimum.
rescale function¶
Renormalize arr from one range to another.
rescale_float_to_int_nb function¶
Rescale a float array into an int array.
rescale_nb function¶
Numba-compiled version of rescale().
squeeze_nan function¶
Squeeze NaN values using a mask.
uniform_summing_to_one_nb function¶
Generate random floats summing to one.
See # https://stackoverflow.com/a/2640067/8141780
unsqueeze_nan function¶
Un-squeeze NaN values using a mask.