arkouda.array_api.creation_functions¶
Functions¶
|
Return a 1D of array of evenly spaced values within the half-open interval [start, stop) |
|
Create a new Array from one of: |
|
Return a new array of given shape and type, without initializing entries. |
|
Return a new array whose shape and dtype match the input array, without initializing entries. |
|
Return a 2D array with ones on the diagonal and zeros elsewhere. |
|
Construct an Array from a DLPack tensor. |
|
Return a new array of given shape and type, filled with fill_value. |
|
Return a new array whose shape and dtype match the input array, filled with fill_value. |
|
An Array API compliant wrapper for |
|
Return coordinate matrices from coordinate vectors. |
|
Return a new array with the specified shape and type, filled with ones. |
|
Return a new array whose shape and dtype match the input array, filled with ones. |
|
Create a new array with the values from x below the k-th diagonal, and |
|
Create a new array with the values from x above the k-th diagonal, and |
|
Return a new array with the specified shape and type, filled with zeros. |
|
Return a new array whose shape and dtype match the input array, filled with zeros. |
Module Contents¶
- arkouda.array_api.creation_functions.arange(start: int | float, /, stop: int | float | None = None, step: int | float = 1, *, dtype: arkouda.array_api._typing.Dtype | None = None, device: arkouda.array_api._typing.Device | None = None) arkouda.array_api.array_object.Array [source]¶
Return a 1D of array of evenly spaced values within the half-open interval [start, stop)
- Parameters:
start (Union[int, float]) – If stop is None, this is the stop value and start is 0. Otherwise, this is the start value (inclusive).
stop (Optional[Union[int, float]]) – The end value of the sequence (exclusive).
step (Union[int, float]) – Spacing between values (default is 1).
dtype (Optional[Dtype]) – The data type of the output array. If None, use float64.
- arkouda.array_api.creation_functions.asarray(obj: arkouda.array_api.array_object.Array | bool | int | float | arkouda.array_api._typing.NestedSequence[bool | int | float] | arkouda.array_api._typing.SupportsBufferProtocol | arkouda.pdarray | numpy.ndarray, /, *, dtype: arkouda.array_api._typing.Dtype | None = None, device: arkouda.array_api._typing.Device | None = None, copy: bool | None = None) arkouda.array_api.array_object.Array [source]¶
Create a new Array from one of: - another Array - a scalar value (bool, int, float) - a sequence of scalar values (not yet implemented) - a buffer (not yet implemented) - an arkouda
pdarray
- a numpy ndarray- Parameters:
obj – The object to convert to an Array
dtype (Optional[Dtype]) – The dtype of the resulting Array. If None, the dtype is inferred from the input object
device (Optional[Device]) – The device on which to create the Array (not yet implemented)
copy (Optional[bool]) – Whether to copy the input object (not yet implemented)
- arkouda.array_api.creation_functions.empty(shape: int | Tuple[int, Ellipsis], *, dtype: arkouda.array_api._typing.Dtype | None = None, device: arkouda.array_api._typing.Device | None = None) arkouda.array_api.array_object.Array [source]¶
Return a new array of given shape and type, without initializing entries.
- arkouda.array_api.creation_functions.empty_like(x: arkouda.array_api.array_object.Array, /, *, dtype: arkouda.array_api._typing.Dtype | None = None, device: arkouda.array_api._typing.Device | None = None) arkouda.array_api.array_object.Array [source]¶
Return a new array whose shape and dtype match the input array, without initializing entries.
- arkouda.array_api.creation_functions.eye(n_rows: int, n_cols: int | None = None, /, *, k: int = 0, dtype: arkouda.array_api._typing.Dtype | None = None, device: arkouda.array_api._typing.Device | None = None) arkouda.array_api.array_object.Array [source]¶
Return a 2D array with ones on the diagonal and zeros elsewhere.
- Parameters:
n_rows (int) – Number of rows in the output.
n_cols (Optional[int]) – Number of columns in the output. If None, defaults to n_rows.
k (int) – Index of the diagonal: 0 (the default) refers to the main diagonal, a positive value refers to an upper diagonal, and a negative value to a lower diagonal.
dtype (Optional[Dtype]) – Data type of the returned array. If None, use float64.
- arkouda.array_api.creation_functions.from_dlpack(x: object, /) arkouda.array_api._typing.Array [source]¶
Construct an Array from a DLPack tensor.
WARNING: This function is not yet implemented.
- arkouda.array_api.creation_functions.full(shape: int | Tuple[int, Ellipsis], fill_value: int | bool | float, *, dtype: arkouda.array_api._typing.Dtype | None = None, device: arkouda.array_api._typing.Device | None = None) arkouda.array_api._typing.Array [source]¶
Return a new array of given shape and type, filled with fill_value.
- arkouda.array_api.creation_functions.full_like(x: arkouda.array_api._typing.Array, /, fill_value: int | float, *, dtype: arkouda.array_api._typing.Dtype | None = None, device: arkouda.array_api._typing.Device | None = None) arkouda.array_api._typing.Array [source]¶
Return a new array whose shape and dtype match the input array, filled with fill_value.
- arkouda.array_api.creation_functions.linspace(start: int | float, stop: int | float, /, num: int, *, dtype: arkouda.array_api._typing.Dtype | None = None, device: arkouda.array_api._typing.Device | None = None, endpoint: bool = True) arkouda.array_api.array_object.Array [source]¶
An Array API compliant wrapper for
arkouda.linspace()
.
- arkouda.array_api.creation_functions.meshgrid(*arrays: arkouda.array_api._typing.Array, indexing: str = 'xy') List[arkouda.array_api._typing.Array] [source]¶
Return coordinate matrices from coordinate vectors.
WARNING: This function is not yet implemented.
- arkouda.array_api.creation_functions.ones(shape: int | Tuple[int, Ellipsis], *, dtype: arkouda.array_api._typing.Dtype | None = None, device: arkouda.array_api._typing.Device | None = None) arkouda.array_api._typing.Array [source]¶
Return a new array with the specified shape and type, filled with ones.
- arkouda.array_api.creation_functions.ones_like(x: arkouda.array_api._typing.Array, /, *, dtype: arkouda.array_api._typing.Dtype | None = None, device: arkouda.array_api._typing.Device | None = None) arkouda.array_api._typing.Array [source]¶
Return a new array whose shape and dtype match the input array, filled with ones.
- arkouda.array_api.creation_functions.tril(x: arkouda.array_api.array_object.Array, /, *, k: int = 0) arkouda.array_api.array_object.Array [source]¶
Create a new array with the values from x below the k-th diagonal, and all other elements zero.
- arkouda.array_api.creation_functions.triu(x: arkouda.array_api.array_object.Array, /, *, k: int = 0) arkouda.array_api.array_object.Array [source]¶
Create a new array with the values from x above the k-th diagonal, and all other elements zero.
- arkouda.array_api.creation_functions.zeros(shape: int | Tuple[int, Ellipsis], /, *, dtype: arkouda.array_api._typing.Dtype | None = None, device: arkouda.array_api._typing.Device | None = None) arkouda.array_api.array_object.Array [source]¶
Return a new array with the specified shape and type, filled with zeros.
- arkouda.array_api.creation_functions.zeros_like(x: arkouda.array_api._typing.Array, /, *, dtype: arkouda.array_api._typing.Dtype | None = None, device: arkouda.array_api._typing.Device | None = None) arkouda.array_api._typing.Array [source]¶
Return a new array whose shape and dtype match the input array, filled with zeros.