import dascore # import dascore library
pa = dascore.get_example_patch() # generate example patch
# Transpose the time and data array dimensions in the example patch
out = pa.transpose("time", "distance")
# Set "distance" as the last dimension
out = pa.transpose(..., "distance")
# Set distance as the first dimension.
out = pa.transpose("distance", ...)Transpose
Transpose(
*args ,
dims: tuple[Any, …] = (),
)-> None
Transpose the data array to any dimension order desired.
Parameters
| Parameter | Description |
|---|---|
| *dims |
Dimension names which define the new data axis order. Can also include … to indicate dimensions that should be left alone. |
Examples
Methods
| Name | Description |
|---|---|
| check | Refuse a patch which does not carry what the operation needs. |
| get_metadata | Return the coordinates in their new order, and the permutation. |
| kernel | Return the data with its axes permuted, or as it was. |
| model_copy | Copy the model, dropping cached values the update invalidates. |
| new | Create new instance with some attributed updated. |
| transpose | Transpose the data array to any dimension order desired. |
| reconcile | Return metadata or a patch holding the final data; default as is. |
| run | Run the operation: check, get_metadata, kernel, reconcile, record. |