-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Series.cumin/cummax fails with datetime64[ns, tz] dtype #15553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Milestone
Comments
Note there's also odd behaviour on tz-aware series with >>> import pandas as pd
>>> utc = pd.Series(pd.to_datetime(['now'], utc=True))
>>> utc.dtype
datetime64[ns, UTC]
>>> utc.combine_first(utc).dtype
dtype('<M8[ns]')
>>> utc.update(utc)
~/anaconda3/lib/python3.5/site-packages/pandas/core/internals.py:1517: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
new = new[mask]
Traceback (most recent call last):
File "bug.py", line 1, in <module>
utc.update(utc)
File "~/anaconda3/lib/python3.5/site-packages/pandas/core/series.py", line 1718, in update
self._data = self._data.putmask(mask=mask, new=other, inplace=True)
File "~/anaconda3/lib/python3.5/site-packages/pandas/core/internals.py", line 3171, in putmask
return self.apply('putmask', **kwargs)
File "~/anaconda3/lib/python3.5/site-packages/pandas/core/internals.py", line 3056, in apply
applied = getattr(b, f)(**kwargs)
File "~/anaconda3/lib/python3.5/site-packages/pandas/core/internals.py", line 1517, in putmask
new = new[mask]
IndexError: index 1 is out of bounds for axis 0 with size 1 |
And >>> utc.cummax().dtype
dtype('<M8[ns]')
>>> utc.cummin().dtype
dtype('<M8[ns]') |
#21660 closed |
Looks like the DataFrame cummin/cummax methods are OK, just the Series ones are losing timezones I think this is because |
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
.where
.combine_first
.update
.cummin/cummax
works with naive dt, should work with tz-aware
The text was updated successfully, but these errors were encountered: