ak.size — Awkward Array documentation

# ak.size

Defined in awkward.operations.structure on line 4347.

ak.size(array, axis=None)
  Parameters:

    - array – Rectilinear array whose `shape` needs to be known.

    - axis (int) – The dimension at which this operation is applied. The outermost dimension is `0`, followed by `1`, etc., and negative values count backward from the innermost: `-1` is the innermost dimension, `-2` is the next level up, etc.

Returns an int or a list of ints, one for each regular dimension.

Implements NumPy’s size function in a way that accepts `ak.Array` as the `array`.

If the `array` is not rectilinear (i.e. if #np.to_numpy would raise an error), then this function raise an error.