coords.Coords.permute_axes#
- Coords.permute_axes(order)#
Permute the coordinate axes.
Parameters#
- order: list of 3 int
The new order of the axes. Normally this is a list of the 3 values 0, 1, 2. It is however allowed to have identical value, like 0, 0, 2. The latter will effectively project all points in the y-direction onto the (x,y) bisector plane.
Returns#
- Coords
A new Coords instance with the axes reordered according to order. If duplicate indices are provided in order, the corresponding coordinate values are repeated.
Examples#
>>> X = Coords(np.arange(6).reshape(-1,3)) >>> X Coords([[0., 1., 2.], [3., 4., 5.]]) >>> X.permute_axes([2,1,0]) Coords([[2., 1., 0.], [5., 4., 3.]]) >>> X.permute_axes([1,2,0]) Coords([[1., 2., 0.], [4., 5., 3.]]) >>> X.permute_axes([0,2,2]) Coords([[0., 2., 2.], [3., 5., 5.]])