NDArray API#

The multidimensional data array class. This class consists of a set of useful parameters and methods that allow not only to define an array correctly, but also to handle it in a simple way, being able to extract multidimensional slices from it.

Methods#

__getitem__

Get a (multidimensional) slice as specified in key.

__setitem__

Set a slice.

copy

Create a copy of an array with same parameters.

iterchunks_info

Iterate over self chunks, providing info on index and special values.

slice

Get a (multidimensional) slice as a new NDArray.

squeeze

Remove the 1's in array's shape.

resize

Change the shape of the array by growing or shrinking one or more dimensions.

tobytes

Returns a buffer with the data contents.

to_cframe

Get a bytes object containing the serialized NDArray instance.

Attributes#

ndim

The number of dimensions of this container.

shape

The data shape of this container.

ext_shape

The padded data shape.

chunks

The data chunk shape of this container.

ext_chunks

The padded chunk shape which defines the chunksize in the associated schunk.

blocks

The block shape of this container.

blocksize

The block size (in bytes) for this container.

chunksize

The data chunk size (in bytes) for this container.

dtype

Data-type of the array’s elements.

info

Print information about this array.

schunk

The SChunk reference of the NDArray.

size

The size (in bytes) for this container.

Constructors#

asarray

Convert the array to an NDArray.

copy

This is equivalent to NDArray.copy()

empty

Create an empty array.

frombuffer

Create an array out of a buffer.

full

Create an array, with fill_value being used as the default value for uninitialized portions of the array.

ndarray_from_cframe

Create a NDArray instance out of a contiguous frame buffer.

uninit

Create an array with uninitialized values.

zeros

Create an array, with zero being used as the default value for uninitialized portions of the array.

Functions#

sin

Trigonometric sine, element-wise.

cos

Trigonometric cosine, element-wise.

tan

Trigonometric tangent, element-wise.

sinh

Hyperbolic sine, element-wise.

cosh

Hyperbolic cosine, element-wise.

tanh

Hyperbolic tangent, element-wise.

arcsin

Inverse sine, element-wise.

arccos

Trigonometric inverse cosine, element-wise.

arctan

Trigonometric inverse tangent, element-wise.

arctan2

Element-wise arc tangent of ndarr1 / ndarr2 choosing the quadrant correctly.

arcsinh

Inverse hyperbolic sine, element-wise.

arccosh

Inverse hyperbolic cosine, element-wise.

arctanh

Inverse hyperbolic tangent, element-wise.

exp

Calculate the exponential of all elements in the input array.

expm1

Calculate exp(ndarr) - 1 for all elements in the array.

log

Natural logarithm, element-wise.

log10

Return the base 10 logarithm of the input array, element-wise.

log1p

Return the natural logarithm of one plus the input array, element-wise.

sqrt

Return the non-negative square-root of an array, element-wise.

conj

Return the complex conjugate, element-wise.

real

Return the real part of the complex array, element-wise.

imag

Return the imaginary part of the complex array, element-wise.

contains

Check if the array contains a string value.

abs

Calculate the absolute value element-wise.