transpose

function of dascore.proc.coords source

transpose(
    self: Patch ,
    *dims: str ,
)-> ‘PatchType’

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 diemsnions that should be left
alone.

Examples

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", ...)