-
-
Notifications
You must be signed in to change notification settings - Fork 141
error: Argument 1 to "mul" of "Series" has incompatible type "timedelta64" [arg-type] #748
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
Comments
Need to coordinate the definitions of |
Any kind of multiplication of a series with Timedeltas induce a I have quickly tested |
Let's leave the scope as is. The challenge here is that you could get a So make a PR that just aligns the arguments for things like Separately, if you want to experiment with using Thanks for your contributions! |
Series[int] or Series[float] works fine of course for >>> s2 = pd.Series([1, 2, 3])
>>> s2 * np.timedelta64(1, "s")
0 0 days 00:00:01
1 0 days 00:00:02
2 0 days 00:00:03
dtype: timedelta64[s]
>>> s2 + np.timedelta64(1, "s")
(...)
TypeError: Concatenation operation is not implemented for NumPy arrays, use np.concatenate() instead. Please do not rely on this error; it may not be given on all Python implementations. however with Series[object] (as we mix int and timedelta): >>> s = pd.Series([1, 2, 3, np.timedelta64(1, "s")])
>>> s
0 1
1 2
2 3
3 1 seconds
>>> s * np.timedelta64(1, "s")
(...)
numpy.core._exceptions._UFuncBinaryResolutionError: ufunc 'multiply' cannot use operands with types dtype('O') and dtype('<m8[s]')
>>> s + np.timedelta64(1, "s")
(...)
TypeError: unsupported operand type(s) for +: 'Timedelta' and 'int'
>>> s[0:2] * np.timedelta64(1, "s")
(...)
numpy.core._exceptions._UFuncBinaryResolutionError: ufunc 'multiply' cannot use operands with types dtype('O') and dtype('<m8[s]')
I can not find any case where Series I will PR what I have done for |
* adding tests for #748 * updating __rmul__, rmul and mul --------- Co-authored-by: Laurent Mutricy <[email protected]>
Describe the bug
Series.mul
has incompatible signature withSeries.__mul__
To Reproduce
Please complete the following information:
The text was updated successfully, but these errors were encountered: