-
- Notifications
You must be signed in to change notification settings - Fork 19.2k
Open
Labels
BugFrequencyDateOffsetsDateOffsetsIndexRelated to the Index class or subclassesRelated to the Index class or subclassessetopsunion, intersection, difference, symmetric_differenceunion, intersection, difference, symmetric_difference
Description
import pandas as pd off = pd.offsets.CDay(1, False) ts = pd.Timestamp("2021-10-13 09") ts2 = ts + pd.Timedelta("1 hour") dti = pd.date_range(start=ts, periods=10, freq=off) dti2 = pd.date_range(start=ts2, periods=10, freq=off) assert set(dti).intersection(set(dti2)) == set() # yep! res = dti.intersection(dti2) assert len(res) == 0 # nope!
_can_fast_intersect is wrong for the non-anchored case, returning self.freq.n == 1
which is not sufficient in this case. It may be that we just need to return False for non-anchored.
Expected Behavior
The intersection should be empty
Metadata
Metadata
Assignees
Labels
BugFrequencyDateOffsetsDateOffsetsIndexRelated to the Index class or subclassesRelated to the Index class or subclassessetopsunion, intersection, difference, symmetric_differenceunion, intersection, difference, symmetric_difference