pyxx.arrays

Code for processing lists, tuples, or other array-formatted data

The pyxx.arrays module is intended to assist with processing data stored in lists, tuples, NumPy arrays, or other matrix or tensor formats.

Type-Specific Lists

These classes provide nearly identical functionality as a Python list but, similar to C++ std::vector objects, they additionally enforce the requirement (albeit not as strictly as C++) that all items in the list be of a specific type.

Inheritance diagram of TypedList, TypedListWithID

TypedList(*values, list_type[, ...])

A list whose elements must be of a specific type

TypedListWithID(*values, list_type[, ...])

A list whose elements must be of a specific type, where each class instance is given a unique identifier

Array Conversion

The functions in this section can be used to convert values to an array, or to convert one or more arrays of one type to a different type.

convert_to_tuple(value)

Convert an input to a tuple

Array Equality

The functions in this section are intended to check whether arrays have equal size and/or content.

is_array_equal(item1, item2, *args[, tol])

Checks that arrays are equal in shape and content

Array Size

These functions can be useful when determining or comparing the sizes of array-like objects.

check_len_equal(item1, item2, *args)

Checks whether the lengths of a set of sequence-type objects are equal

is_len_equal(item1, item2, *args)

Checks whether the lengths of a set of sequence-type objects are equal

max_list_item_len(input_list)

Finds the maximum length of any item in a list or tuple