issues: 490593787
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
490593787 | MDU6SXNzdWU0OTA1OTM3ODc= | 3290 | Using min() with skipna=True | 30388627 | closed | 0 | 8 | 2019-09-07T05:20:54Z | 2019-09-08T02:52:57Z | 2019-09-08T02:52:56Z | NONE | MCVE Code Sample```python from datetime impo rt datetime import xarray as xr import os def read_data(f, composition, west, east, north, south): # read data ds = xr.open_dataset(f, group='PRODUCT') # subset to region index = ((ds.longitude > west) & (ds.longitude < east)) ds = ds.where(index) # read composition data = ds[composition][0,:,:] data_units = data.units # read time t = ds['time_utc'] st = datetime.strptime(str(t.min(skipna=True).values), '%Y-%m-%dT%H:%M:%S.%fZ') et = datetime.strptime(str(t.max(skipna=True).values), '%Y-%m-%dT%H:%M:%S.%fZ')
datadir = '/xin/data/TROPOMI/GZ/bug' os.chdir(datadir) west = 112.5; east = 114.5; north = 24; south = 22.5; f = 'S5P_NRTI_L2__O3_____20190825T053303_20190825T053803_09659_01_010107_20190825T061441.nc' lon, lat, data, data_units, st, et = read_data(f, 'ozone_total_vertical_column', west, east, north, south) ``` Problem DescriptionYou can download the data from google drive.
I get errors shown in details, even using
Traceback (most recent call last):
File "/public/software/anaconda/anaconda3/envs/behr/lib/python3.6/site-packages/xarray-0.11.3-py3.6.egg/xarray/core/duck_array_ops.py", line 236, in f
return func(values, axis=axis, **kwargs)
File "/public/software/anaconda/anaconda3/envs/behr/lib/python3.6/site-packages/xarray-0.11.3-py3.6.egg/xarray/core/nanops.py", line 77, in nanmin
'min', dtypes.get_pos_infinity(a.dtype), a, axis)
File "/public/software/anaconda/anaconda3/envs/behr/lib/python3.6/site-packages/xarray-0.11.3-py3.6.egg/xarray/core/nanops.py", line 69, in _nan_minmax_object
data = dtypes.fill_value(value.dtype) if valid_count == 0 else data
AttributeError: module 'xarray.core.dtypes' has no attribute 'fill_value'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "bug.py", line 31, in <module>
west, east, north, south)
File "bug.py", line 16, in read_data
st = datetime.strptime(str(t.min(skipna=True).values), '%Y-%m-%dT%H:%M:%S.%fZ')
File "/public/software/anaconda/anaconda3/envs/behr/lib/python3.6/site-packages/xarray-0.11.3-py3.6.egg/xarray/core/common.py", line 25, in wrapped_func
skipna=skipna, allow_lazy=True, **kwargs)
File "/public/software/anaconda/anaconda3/envs/behr/lib/python3.6/site-packages/xarray-0.11.3-py3.6.egg/xarray/core/dataarray.py", line 1597, in reduce
var = self.variable.reduce(func, dim, axis, keep_attrs, **kwargs)
File "/public/software/anaconda/anaconda3/envs/behr/lib/python3.6/site-packages/xarray-0.11.3-py3.6.egg/xarray/core/variable.py", line 1354, in reduce
axis=axis, **kwargs)
File "/public/software/anaconda/anaconda3/envs/behr/lib/python3.6/site-packages/xarray-0.11.3-py3.6.egg/xarray/core/duck_array_ops.py", line 249, in f
raise NotImplementedError(msg)
NotImplementedError: min is not available with skipna=False with the installed version of numpy; upgrade to numpy 1.12 or newer to use skipna=True or skipna=None
Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3290/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |