is there a neat way to reduce entire dataset dimension size x and y without changing datatype for variables? #6465
-
I'm trying to reduce my xarray dataset dimension (x and y) by one, e.g. 257x257 to 256x256. This code is what I have tried:
When I run this code, all variables change the data type to float64 (probably because where() statement converts to "nan" while selecting data). Is there a better way of doing this without changing the data type of all the variables to float64? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
this really depends on what value you want to drop, but you could use cube.isel(x=slice(None, -1), y=slice(None, -1)) |
Beta Was this translation helpful? Give feedback.
this really depends on what value you want to drop, but you could use
isel
with the appropriateslice
, e.g. to drop the last element: