tuple_array

class array_collections.tuple_array[source]

Create an array that is immutable and hashable.

Parameters

array: [array_like] Input data, in any form that can be converted to an array. This includes lists, lists of tuples, tuples, tuples of tuples, tuples of lists and ndarrays.

dtype: [data-type] By default, the data-type is inferred from the input data.

order: {‘C’, ‘F’} Whether to use row-major (C-style) or column-major (Fortran-style) memory representation. Defaults to ‘C’.

Examples

Create a tuple_array object:

>>> arr = tuple_array([1, 18])
tuple_array([1, 18])

tuple_array objects are immutable:

>>> arr[1] = 0
TypeError: 'tuple_array' objects are immutable.

tuple_array objects are hashable:

>>> hash(arr)
3713080549427813581