You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
yep, looks like an untested case. (fix is trivial, just use tslib.iNaT, but needs tests
In [1]: Series([]).quantile(.5)
Out[1]: nan
In [2]: Series([],dtype='M8[ns]').quantile(.5)
NameError: global name 'iNaT' is not defined
In [3]: Series([],dtype='m8[ns]').quantile(.5)
NameError: global name 'iNaT' is not defined
Changes to be committed:
modified: pandas/core/series.py
modified: pandas/tests/test_series.py
Fixes global reference to iNaT (should be tslib.iNaT) in series._maybe_box.
Adds test `test_datetime_timedelta_quantiles` to check for proper return value
in test_series.py.
Issue #9675
Trying to perform this operation on a groupby object called clusters:
clusters.agg({'diffs': lambda x: x.quantile(.5)})
where diffs is a column of Timedelta objects.
Getting the error:
Looks like other references to iNaT are all tslib.iNaT.
https://github.com/pydata/pandas/blob/master/pandas/core/series.py#L2098
The text was updated successfully, but these errors were encountered: