issues: 507524966
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
507524966 | MDU6SXNzdWU1MDc1MjQ5NjY= | 3404 | groupby_bins raises ufunc 'isnan' error on 0.14.0 | 13837821 | closed | 0 | 1 | 2019-10-15T23:02:34Z | 2019-10-17T21:13:45Z | 2019-10-17T21:13:45Z | CONTRIBUTOR | I recently upgraded to xarray 0.14.0. When running code that used to work in 0.13, I get a MCVE Code Sample```python import xarray as xr import pandas as pd import numpy as np ts = pd.date_range(start='2010-08-01', end='2010-08-15', freq='24.8H') ds = xr.Dataset() ds['time'] = xr.DataArray(pd.date_range('2010-08-01', '2010-08-15', freq='15min'), dims='time') ds['val'] = xr.DataArray(np.random.rand(*ds['time'].shape), dims='time') ds.groupby_bins('time', ts) #error thrown here ``` Full error details below.
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-35-43742bae2c94> in <module>
9 ds['val'] = xr.DataArray(np.random.rand(*ds['time'].shape), dims='time')
10
---> 11 ds.groupby_bins('time', ts)
~/miniconda3/lib/python3.7/site-packages/xarray/core/common.py in groupby_bins(self, group, bins, right, labels, precision, include_lowest, squeeze, restore_coord_dims)
727 "labels": labels,
728 "precision": precision,
--> 729 "include_lowest": include_lowest,
730 },
731 )
~/miniconda3/lib/python3.7/site-packages/xarray/core/groupby.py in __init__(self, obj, group, squeeze, grouper, bins, restore_coord_dims, cut_kwargs)
322
323 if bins is not None:
--> 324 if np.isnan(bins).all():
325 raise ValueError("All bin edges are NaN.")
326 binned = pd.cut(group.values, bins, **cut_kwargs)
TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3404/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |