We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
have to return timedelta64[ns] scalars
type: timedelta64[ns] In [23]: s = pd.to_timedelta(np.arange(5),unit='d') In [24]: s Out[24]: 0 00:00:00 1 1 days, 00:00:00 2 2 days, 00:00:00 3 3 days, 00:00:00 4 4 days, 00:00:00 dtype: timedelta64[ns] In [25]: s + timedelta(hours=1) Out[25]: 0 01:00:00 1 1 days, 01:00:00 2 2 days, 01:00:00 3 3 days, 01:00:00 4 4 days, 01:00:00 dtype: timedelta64[ns] In [26]: s + pd.offsets.Hour(1) Out[26]: 0 01:00:00 1 1 days, 01:00:00 2 2 days, 01:00:00 3 3 days, 01:00:00 4 4 days, 01:00:00 dtype: timedelta64[ns] In [27]: s.iloc[2] + pd.offsets.Hour(1) TypeError: ufunc add cannot use operands with types dtype('<m8[ns]') and dtype('O') In [29]: s.iloc[2] + timedelta(hours=1) TypeError: ufunc add cannot use operands with types dtype('<m8[ns]') and dtype('O')
This works (wrapping in a np.timedeltat64
In [31]: s.iloc[2] += np.timedelta64(timedelta(hours=1)) In [32]: s Out[32]: 0 00:00:00 1 1 days, 00:00:00 2 2 days, 01:00:00 3 3 days, 00:00:00 4 4 days, 00:00:00 dtype: timedelta64[ns]
Reevaluate whether summary ops should just return the np.timdelta64 scalar (not as pretty though)
In [33]: s.mean() Out[33]: 0 2 days, 00:12:00 dtype: timedelta64[ns] In [34]: s.mean().iloc[0] Out[34]: numpy.timedelta64(173520000000000,'ns')
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
have to return timedelta64[ns] scalars
This works (wrapping in a np.timedeltat64
Reevaluate whether summary ops should just return the np.timdelta64 scalar
(not as pretty though)
The text was updated successfully, but these errors were encountered: