PlasmaCalcs.tools.arrays.ndindex_array
- PlasmaCalcs.tools.arrays.ndindex_array(shape)
- returns an array of indexes, where each element is its own np.ndindex.For 0D, crash with DimensionalityError.For 1D, result[i] == i(Do not use tuple results for 1D. Also, optimize dtype to np.min_scalar_type.)E.g. ndindex_array((3,)) –> np.array([0,1,2], dtype=uint8).For 2D+, result[index] == index, where index is a tuple.E.g. in 2D, result[i,j] == (i,j). And, ndindex_array((2,3)) –>np.array([[(0,0),(0,1),(0,2)], [(1,0),(1,1),(1,2)]], dtype=object)