Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

make coordinate cyclic in python

# To adjust coordinate labels or make axis cyclic or periodic,
# you can use the Shift() and/or roll() methods as shown below:

import xarray as xr


array = xr.DataArray([1, 2, 3, 4], dims="x")

# shift the coordinate 'x' (to the right) by 2
array.shift(x=2)

# roll the coordinate 'x' (toward the right) by 2
array.roll(x=2, roll_coords=True)

Source by docs.xarray.dev #
 
PREVIOUS NEXT
Tagged: #coordinate #cyclic #python
ADD COMMENT
Topic
Name
9+9 =