Hello everyone,
I am wondering if anyone happens to know to select a few Data variables and drop the rest (most of the all).
For instance, in the following example at http://xarray.pydata.org/en/stable/examples/quick-overview.html
In [38]: ds.to_netcdf('example.nc')
In [39]: xr.open_dataset('example.nc')
Out[39]:
<xarray.Dataset>
Dimensions: (x: 2, y: 3)
Coordinates:
* x (x) object 'a' 'b'
Dimensions without coordinates: y
Data variables:
baz float64 3.142
foo (x, y) float64 -1.295 0.4137 0.2767 -0.472 -0.01396 -0.3625
bar (x) int64 1 2
In [40]: ds2 = xr.open_dataset('example.nc')
, how can we just select the data variables 'foo' and 'bar' for the dataset ds2. Thank you very much for your helps.
Best regards,
Yan