-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
ENH: Arithmetic with Timestamp-based intervals #35908
Comments
IIRC arithmetic between integers and Timestamp was deprecated + removed some time ago cc @jbrockmendel
Therefore, I don't think it will be likely to support arithmetic between an Interval with integers and a Timestamp |
My intervals contain only Timestamp, no integers. I want to subtract a Timestamp from another Timestamp. I hope that isn't deprecated. |
Ah sorry, I had copied the incorrect example locally. Yes, that request sounds reasonable. Given your integer example works, TImestamp arithmetic should work as well. |
Sounds good, it would be great if I could work on this. Do we need further discussion about this feature? |
Go for it @souris-dev |
take |
Is your feature request related to a problem?
It is currently possible to perform arithmetic on an
Interval
iff it is anInterval
of numbers. ForInterval
iv
,iv - c == Interval(iv.left-c, iv.right-c)
. This does not work for intervals ofTimestamp
s:Describe the solution you'd like
I would like that the behaviour that
iv - b == Interval(iv.left-b, iv.right-b)
holds for all types thatInterval
can hold, includingTimestamp
s andTimedelta
s.API breaking implications
No backward compatibility issues expected.
Describe alternatives you've considered
Users can currently resort to
Interval(iv.left-b, iv.right-b)
. This is more typing and required repeating the expressionb
.The text was updated successfully, but these errors were encountered: