Skip to content

daterange intersection issue #771

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

Closed
tejrai opened this issue Feb 9, 2012 · 1 comment
Closed

daterange intersection issue #771

tejrai opened this issue Feb 9, 2012 · 1 comment
Labels
Milestone

Comments

@tejrai
Copy link

tejrai commented Feb 9, 2012

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: 23

b = 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: 7

a.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

@wesm
Copy link
Member

wesm commented Feb 9, 2012

Fixed this in master, will be part of 0.7.0 final. thanks for the report!

@wesm wesm closed this as completed Feb 9, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants