mlnext.utils#

Module with utility functions.

Functions

check_ndim

Checks whether each passed array has exactly ndim number of dimensions, if strict is false then the number of dimensions must be at most ndim.

check_shape

Checks the shape of one or more arrays.

check_size

Checks whether each array has exactly size elements along axis, if strict is false then it must be at most size elements.

flatten

Turns a nested mapping into a flattened mapping.

rename_keys

Renames every key in mapping with a prefix and/or suffix.

truncate

Truncates the arrays in each tuple to the minimum length of an array in

Classes

RangeDict

Dictionary that accepts range keys.