flattenix#

pybrops.core.util.array.flattenix(arr)[source]#

Flatten an array and return a tuple of axis indices corresponding to their position along that axis.

Parameters:

arr (numpy.ndarray) – An array to flatten and generate an axis index tuple.

Returns:

out – A tuple of the flattened array and axis indices. (flatarr, axisix)

Return type:

tuple