cunumeric.ndarray#

class cunumeric.ndarray#
__init__(shape: Any, dtype: npt.DTypeLike = <class 'numpy.float64'>, buffer: Any | None = None, offset: int = 0, strides: tuple[int] | None = None, order: OrderType | None = None, thunk: NumPyThunk | None = None, inputs: Any | None = None, writeable: bool = True) None#

Methods

__init__(shape[, dtype, buffer, offset, ...])

__index__()

all([axis, out, keepdims, initial, where])

Returns True if all elements evaluate to True.

any([axis, out, keepdims, initial, where])

Returns True if any of the elements of a evaluate to True.

argmax([axis, out])

Return indices of the maximum values along the given axis.

argmin([axis, out])

Return indices of the minimum values along the given axis.

argpartition(kth[, axis, kind, order])

Returns the indices that would partition this array.

argsort([axis, kind, order])

Returns the indices that would sort this array.

astype(dtype[, order, casting, subok, copy])

Copy of the array, cast to a specified type.

choose(choices[, out, mode])

Use an index array to construct a new array from a set of choices.

clip([min, max, out])

Return an array whose values are limited to [min, max].

compress(self, condition[, axis, out])

Return selected slices of an array along given axis.

conj()

Complex-conjugate all elements.

conjugate()

Return the complex conjugate, element-wise.

copy()

Get a copy of the iterator as a 1-D array.

diagonal([offset, axis1, axis2])

Return specified diagonals.

dot(rhs[, out])

Return the dot product of this array with rhs.

dump(file)

Dump a pickle of the array to the specified file.

dumps()

Returns the pickle of the array as a string.

fill(value)

Fill the array with a scalar value.

flatten([order])

Return a copy of the array collapsed into one dimension.

flip([axis])

Reverse the order of elements in an array along the given axis.

getfield(dtype[, offset])

item(*args)

Copy an element of an array to a standard Python scalar and return it.

itemset

max([axis, out, keepdims, initial, where])

a.max(axis=None, out=None, keepdims=False, initial=<no value>,

mean([axis, dtype, out, keepdims])

Returns the average of the array elements along given axis.

min([axis, out, keepdims, initial, where])

a.min(axis=None, out=None, keepdims=False, initial=<no value>,

nonzero()

Return the indices of the elements that are non-zero.

partition(kth[, axis, kind, order])

Partition of an array in-place.

prod([axis, dtype, out, keepdims, initial, ...])

a.prod(axis=None, dtype=None, out=None, keepdims=False, initial=1, where=True)

put(indices, values[, mode])

Replaces specified elements of the array with given values.

ravel([order])

Return a flattened array.

reshape(shape[, order])

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

searchsorted(v[, side, sorter])

Find the indices into a sorted array a such that, if the corresponding elements in v were inserted before the indices, the order of a would be preserved.

setfield(val, dtype[, offset])

setflags([write, align, uic])

Set array flags WRITEABLE, ALIGNED, WRITEBACKIFCOPY, respectively.

sort([axis, kind, order])

Sort an array in-place.

squeeze([axis])

Remove axes of length one from a.

sum([axis, dtype, out, keepdims, initial, where])

a.sum(axis=None, dtype=None, out=None, keepdims=False, initial=0, where=None)

swapaxes(axis1, axis2)

Return a view of the array with axis1 and axis2 interchanged.

take(indices[, axis, out, mode])

Take elements from an array along an axis.

tobytes([order])

Construct Python bytes containing the raw data bytes in the array.

tofile(fid[, sep, format])

Write array to a file as text or binary (default).

tolist()

Return the array as an a.ndim-levels deep nested list of Python scalars.

tostring([order])

A compatibility alias for tobytes, with exactly the same behavior.

transpose([axes])

Returns a view of the array with axes transposed.

unique()

Find the unique elements of an array.

view([dtype, type])

New view of array with the same data.

Attributes

T

The transposed array.

base

Returns dtype for the base element of the subarrays, regardless of their dimension or shape.

ctypes

An object to simplify the interaction of the array with the ctypes module.

data

Python buffer object pointing to the start of the array's data.

dtype

Data-type of the array's elements.

flags

Information about the memory layout of the array.

flat

A 1-D iterator over the array.

imag

The imaginary part of the array.

itemsize

The element size of this data-type object.

nbytes

Total bytes consumed by the elements of the array.

ndim

Number of array dimensions.

real

The real part of the array.

shape

Tuple of array dimensions.

size

Number of elements in the array.

strides

Tuple of bytes to step in each dimension when traversing an array.