NDArray#

The multidimensional data array class.

Methods#

__iter__

Iterate over the (outer) elements of the array.

__len__

__getitem__

Retrieve a (multidimensional) slice as specified by the key.

__setitem__

Set a slice of the array.

copy

Create a copy of an array with different parameters.

get_chunk

Shortcut to SChunk.get_chunk.

indices

Return the indices of a sorted array following the specified order.

iterchunks_info

Iterate over self chunks of the array, providing information on index and special values.

reshape

Return a new array with the specified shape.

resize

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

save

Save the array to a file.

slice

Get a (multidimensional) slice as a new NDArray.

sort

Return a sorted array following the specified order, or the order of the fields.

squeeze

Remove single-dimensional entries from the shape of the array.

tobytes

Returns a buffer containing the data of the entire array.

to_cframe

Get a bytes object containing the serialized NDArray instance.

In addition, all the functions from the Lazy Functions section can be used with NDArray instances.

Attributes#

ndim

The number of dimensions of this container.

shape

Returns the data shape of this container.

ext_shape

The padded data shape.

chunks

Returns the data chunk shape of this container.

ext_chunks

Returns 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

Returns the data chunk size (in bytes) for this container.

dtype

Data-type of the array's elements.

fields

Dictionary with the fields of the structured array.

keep_last_read

Indicates whether the last read data should be kept in memory.

info

Print information about this array.

schunk

The SChunk reference of the NDArray.

size

The size (in bytes) for this container.

cparams

The compression parameters used by the array.

dparams

The decompression parameters used by the array.

urlpath

The URL path of the array.

vlmeta

The variable-length metadata of the array.

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.

fromiter

Create a new array from an iterable object.

nans

Create an array with NaNs values.

ndarray_from_cframe

Create a NDArray instance from a contiguous frame buffer.

uninit

Create an array with uninitialized values.

zeros

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

ones

Create an array with one as values.

full

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

arange

Return evenly spaced values within a given interval.

linspace

Return evenly spaced numbers over a specified interval.

eye

Return a 2-D array with ones on the diagonal and zeros elsewhere.

reshape

Returns an array containing the same data with a new shape.