arkouda.array_api.utility_functions

Functions

all(→ arkouda.array_api.array_object.Array)

Check whether all elements of an array evaluate to True along a given axis.

any(→ arkouda.array_api.array_object.Array)

Check whether any elements of an array evaluate to True along a given axis.

clip(→ arkouda.array_api.array_object.Array)

Clip (limit) the values in an array to a given range.

diff(→ arkouda.array_api.array_object.Array)

Calculate the n-th discrete difference along the given axis.

pad(→ arkouda.array_api.array_object.Array)

Pad an array.

Module Contents

arkouda.array_api.utility_functions.all(x: arkouda.array_api.array_object.Array, /, *, axis: int | Tuple[int, Ellipsis] | None = None, keepdims: bool = False) arkouda.array_api.array_object.Array[source]

Check whether all elements of an array evaluate to True along a given axis.

Parameters:
  • x (Array) – The array to check for all True values

  • axis (int or Tuple[int], optional) – The axis or axes along which to check for all True values. If None, check all elements.

  • keepdims (bool, optional) – Whether to keep the singleton dimensions along axis in the result.

arkouda.array_api.utility_functions.any(x: arkouda.array_api.array_object.Array, /, *, axis: int | Tuple[int, Ellipsis] | None = None, keepdims: bool = False) arkouda.array_api.array_object.Array[source]

Check whether any elements of an array evaluate to True along a given axis.

Parameters:
  • x (Array) – The array to check for any True values

  • axis (int or Tuple[int], optional) – The axis or axes along which to check for any True values. If None, check all elements.

  • keepdims (bool, optional) – Whether to keep the singleton dimensions along axis in the result.

arkouda.array_api.utility_functions.clip(a: arkouda.array_api.array_object.Array, a_min, a_max, /) arkouda.array_api.array_object.Array[source]

Clip (limit) the values in an array to a given range.

Parameters:
  • a (Array) – The array to clip

  • a_min (scalar) – The minimum value

  • a_max (scalar) – The maximum value

arkouda.array_api.utility_functions.diff(a: arkouda.array_api.array_object.Array, /, n: int = 1, axis: int = -1, prepend=None, append=None) arkouda.array_api.array_object.Array[source]

Calculate the n-th discrete difference along the given axis.

Parameters:
  • a (Array) – The array to calculate the difference

  • n (int, optional) – The order of the finite difference. Default is 1.

  • axis (int, optional) – The axis along which to calculate the difference. Default is the last axis.

  • prepend (Array, optional) – Array to prepend to a along axis before calculating the difference.

  • append (Array, optional) – Array to append to a along axis before calculating the difference.

arkouda.array_api.utility_functions.pad(array: arkouda.array_api.array_object.Array, pad_width, mode='constant', **kwargs) arkouda.array_api.array_object.Array[source]

Pad an array.

Parameters:
  • array (Array) – The array to pad

  • pad_width (int or Tuple[int, int] or Tuple[Tuple[int, int], ...]) – Number of values padded to the edges of each axis. If a single int, the same value is used for all axes. If a tuple of two ints, those values are used for all axes. If a tuple of tuples, each inner tuple specifies the number of values padded to the beginning and end of each axis.

  • mode (str, optional) – Padding mode. Only ‘constant’ is currently supported. Use the constant_values keyword argument to specify the padding value or values (in the same format as pad_width).