hsplit#
- class brainunit.math.hsplit(a, indices_or_sections, **kwargs)#
Split a quantity or an array into multiple sub-arrays horizontally (column-wise).
- Parameters:
a (
Array| saiunit.Quantity) – Array to be divided into sub-arrays.indices_or_sections (
int|Sequence[int]) – If indices_or_sections is an integer, N, the array will be divided into N equal arrays along the second axis. If such a split is not possible, an error is raised. If indices_or_sections is a 1-D array of sorted integers, the entries indicate where along the second axis the array is split.
- Returns:
res – A list of sub-arrays.
- Return type:
Sequence[saiunit.Quantity |Array]
Examples
>>> import saiunit as u >>> import jax.numpy as jnp >>> a = jnp.arange(16.0).reshape(4, 4) * u.meter >>> u.math.hsplit(a, 2)