This subject refers to this one I closed earlier: NetCDF4 file with Python - Filter before dataframing
After applying the solution of the other topic to reduce an xarray size
data_9 = ds.sel(time=datetime.time(9))
I have an xarray this way:
But I still can and need to reduce it on latitude and longitude For example I want only longitude between -4 and 44
I tried to apply the function sel again but it doesn't seem to work this time :'(
data_9 = ds.sel(time=datetime.time(9)).sel(lon>-4).sel(lon<44)
Doing this it can't recognise lon...
NameError: name 'lon' is not defined
Can someone helps on this too? Thanks