What do you want to save?
Add Code snippet
New code examples
-
Python 2021-09-20 07:19:05
how to select subset of data in a dataset using xarray
#import xarray import xarray as xr #open the dataset ds = xr.open_dataset(file_name.nc) #get a subset of the data ds.sel(dim=slice()) # input the dimension (dim) to select and the value of the dimension into the slice function(slice) ds.loc[{'dim': slic... Add solution