I have a netCDF file that I opened using xarray. It has the foll. coords:
Coordinates:
* lat (lat) float32 89.875 89.625 89.375 89.125 88.875 88.625 88.375 ...
* lon (lon) float32 -179.875 -179.625 -179.375 -179.125 -178.875 ...
* time (time) int32 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 ...
How can I subset it so that time starts from 2010 instead of 2005 (lat and lon remain the same)? I want an xarray solution only
The .sel method should work, e.g., ds.sel(time=slice(2010, None)). See the docs for more details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With