-
-
Notifications
You must be signed in to change notification settings - Fork 19.1k
BUG: DatetimeIndex intersection with non-anchored freq #62341
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
base: main
Are you sure you want to change the base?
BUG: DatetimeIndex intersection with non-anchored freq #62341
Conversation
pandas/core/indexes/datetimelike.py
Outdated
def _can_fast_intersect(self, other: Self) -> bool: | ||
# Note: we only get here with len(self) > 0 and len(other) > 0 | ||
if self.freq is None: | ||
if self.freq is None or self.freq == "C": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the issue isn't just handling "C", but identifying what conditions work in the general case
This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this. |
@arthurlw are you still working on this? |
Hey @jbrockmendel, i've been a bit swamped with classwork lately. I updated the condition in the PR. Lmk if anything needs to be changed! |
# indexes actually share a common point | ||
# GH#44025 | ||
diff = other[0] - self[0] | ||
if diff != Timedelta(0) and diff.total_seconds() % 86400 != 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clearer just to write diff != Timedelta(days=1)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
of never mind, didn't see the %
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.