Skip to content

Improve arithmetic operations involving CFTimeIndexes and TimedeltaIndexes #2485

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

Merged
merged 3 commits into from
Oct 17, 2018

Conversation

spencerkclark
Copy link
Member

@spencerkclark spencerkclark commented Oct 13, 2018

@pep8speaks
Copy link

Hello @spencerkclark! Thanks for submitting the PR.

return CFTimeIndex(np.array(self) - other)

def _add_delta(self, deltas):
# To support TimedeltaIndex + CFTimeIndex with older pandas versions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has this been changed now? As you know, it's slightly dangerous to dip into pandas internals...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this method is not needed with recent versions of pandas. I think the change that eliminated the need for it was in this PR: pandas-dev/pandas#19895, which I guess would have made it into pandas version 0.23.0.

I added it because of the failing test in the Windows 32-bit Python 2.7 build that used pandas version 0.22.0. Should I just mark the test as an expected failure for versions of pandas less than 0.23 and remove this private method?

@shoyer
Copy link
Member

shoyer commented Oct 15, 2018 via email

@shoyer shoyer merged commit 7cab33a into pydata:master Oct 17, 2018
@spencerkclark spencerkclark deleted the subtract-cftimeindexes branch October 18, 2018 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable add/sub operations involving a CFTimeIndex and a TimedeltaIndex
3 participants