-
-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Description
When using the daterange intersection function, we found that the intersection only partially works as follows:
a = pandas.DateRange('11/30/2011','12/31/2011')
a
<class 'pandas.core.daterange.DateRange'>
offset: <1 BusinessDay>, tzinfo: None
[2011-11-30 00:00:00, ..., 2011-12-30 00:00:00]
length: 23b = pandas.DateRange('12/10/2011','12/20/2011')
b
<class 'pandas.core.daterange.DateRange'>
offset: <1 BusinessDay>, tzinfo: None
[2011-12-12 00:00:00, ..., 2011-12-20 00:00:00]
length: 7a.intersection(b)
<class 'pandas.core.daterange.DateRange'>
offset: <1 BusinessDay>, tzinfo: None
[2011-12-12 00:00:00, ..., 2011-12-30 00:00:00]
length: 15
The intersection function restricts the output on the left side of the range but does not restrict the output on the right side of the range. Ideally, an intersection function should produce the true overlap between the two dateranges instead of the partial (one-sided) overlap.
Thanks,
Tej