arkouda.array_api._array_object

Wrapper class around the ndarray object for the array API standard.

The array API standard defines some behaviors differently than ndarray, in particular, type promotion rules are different (the standard has no value-based casting). The standard also specifies a more limited subset of array methods and functionalities than are implemented on ndarray. Since the goal of the array_api namespace is to be a minimal implementation of the array API standard, we need to define a separate wrapper class for the array_api namespace.

The standard compliant class is only a wrapper class. It is not a subclass of ndarray.

Module Contents

Classes

Array

n-d array object for the array API namespace.

Functions

implements_numpy(numpy_function)

Register an __array_function__ implementation for MyArray objects.

Attributes

class arkouda.array_api._array_object.Array[source]

n-d array object for the array API namespace.

See the docstring of np.ndarray for more information.

This is a wrapper around numpy.ndarray that restricts the usage to only those things that are required by the array API namespace. Note, attributes on this object that start with a single underscore are not part of the API specification and should only be used internally. This object should not be constructed directly. Rather, use one of the creation functions, such as asarray().

property T: Array
property device: arkouda.array_api._typing.Device
property dtype: arkouda.array_api._typing.Dtype
property mT: Array
property ndim: int
property shape: Tuple[int, Ellipsis]
property size: int
item()[source]

Convert the array to a Python scalar

to_device(device: arkouda.array_api._typing.Device, /, stream: None = None) Array[source]
to_ndarray()[source]

Convert the array to a numpy ndarray

tolist()[source]

Convert the array to a Python list or nested lists

transpose(axes: Tuple[int, Ellipsis] | None = None)[source]

Return a view of the array with the specified axes transposed.

For axes=None, reverse all the dimensions of the array.

arkouda.array_api._array_object.HANDLED_FUNCTIONS: Dict[str, Callable]
arkouda.array_api._array_object.implements_numpy(numpy_function)[source]

Register an __array_function__ implementation for MyArray objects.