xray.Dataset.transpose

Dataset.transpose(*dims)

Return a new Dataset object with all array dimensions transposed.

Although the order of dimensions on each array will change, the dataset dimensions themselves will remain in fixed (sorted) order.

Parameters:

*dims : str, optional

By default, reverse the dimensions on each array. Otherwise, reorder the dimensions to this order.

Returns:

transposed : Dataset

Each array in the dataset (including) coordinates will be transposed to the given order.

Notes

Although this operation returns a view of each array’s data, it is not lazy – the data will be fully loaded into memory.