Skip to content

Conversation

@arthurlw
Copy link
Member

@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot added the Stale label Oct 16, 2025
@jbrockmendel
Copy link
Member

@arthurlw are you still working on this?

@arthurlw
Copy link
Member Author

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!

@arthurlw arthurlw marked this pull request as ready for review October 18, 2025 00:54
# indexes actually share a common point
# GH#44025
diff = other[0] - self[0]
if diff != Timedelta(0) and diff.total_seconds() % 86400 != 0:
Copy link
Member

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)?

Copy link
Member

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 %

Copy link
Member

Choose a reason for hiding this comment

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

i dont think this condition ensures they share a point in common. e.g. what if both freqs are Week and they are offset by one day?

Copy link
Member Author

Choose a reason for hiding this comment

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

Assuming the week freqs are created with CDay(7), then self.freq.n is equal to 7 and _can_fast_intersect returns false on the final check:

return self.freq.n == 1

If the freqs are "W" then it seems they snap to Sunday regardless of starting offset.

For specific "W" freqs (e.g. "W-MON", "W-TUE") it returns false on this check:

elif other.freq != self.freq:
    return False

Copy link
Member

Choose a reason for hiding this comment

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

Assuming the week freqs are created with CDay(7)

Why would you assume that. I was thinking pd.offsets.Week(1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: DatetimeIndex.intersection with non-anchored freq

2 participants