home / github / issues

Menu
  • GraphQL API
  • Search all tables

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')

# read lon and lat
lon = data.coords['longitude']
lat = data.coords['latitude']

return lon, lat, data, data_units, st, et

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 Description

You can download the data from google drive. I get errors shown in details, even using skipna=True.

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 xr.show_versions()

# Paste the output here xr.show_versions() here INSTALLED VERSIONS ------------------ commit: None python: 3.6.7 | packaged by conda-forge | (default, Feb 20 2019, 02:51:38) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 3.0.76-0.11-default machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 libhdf5: 1.10.4 libnetcdf: 4.6.2 xarray: 0.11.3 pandas: 0.20.3 numpy: 1.13.1 scipy: 0.19.1 netCDF4: 1.4.2 pydap: None h5netcdf: None h5py: 2.9.0 Nio: None zarr: None cftime: 1.0.3.4 PseudonetCDF: None rasterio: 1.0.21 cfgrib: None iris: None bottleneck: None cyordereddict: None dask: 1.1.2 distributed: None matplotlib: 3.0.3 cartopy: 0.17.0 seaborn: 0.9.0 setuptools: 36.4.0 pip: 9.0.1 conda: None pytest: None IPython: None sphinx: None
{
    "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

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 8 rows from issue in issue_comments
Powered by Datasette · Queries took 10321.985ms · About: xarray-datasette