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