moveaxis¶
-
sparse.
moveaxis
(a, source, destination)[source]¶ Move axes of an array to new positions.
Other axes remain in their original order.
- Parameters
- Returns
Array with moved axes.
- Return type
Examples
>>> import numpy as np >>> import sparse >>> x = sparse.COO.from_numpy(np.ones((2, 3, 4, 5))) >>> sparse.moveaxis(x, (0, 1), (2, 3)) <COO: shape=(4, 5, 2, 3), dtype=float64, nnz=120, fill_value=0.0>