Skip to content
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

BUG: DatetimeIndex uses the wrong union if the operands overlap #4564

Merged
merged 1 commit into from
Sep 26, 2013

Conversation

filmor
Copy link
Contributor

@filmor filmor commented Aug 15, 2013

This pretty much boils down to this line: https://github.com/pydata/pandas/blob/master/pandas/tseries/index.py#L987

You can easily reproduce the error using the following code:

r = pd.date_range("2013-01-01", "2013-02-01")
r2 = r + pd.DateOffset(minutes=15)
r | r2 # Results in the index r having "2013-01-31 00:15" appended

This happens because the check on the given line does not take into account, that two indices with the same offset do not necessarily have to be aligned. If they are the _fast_union-method can be used, if not it should fall back to the Index implementation.

@jreback
Copy link
Contributor

jreback commented Aug 14, 2013

seems easy enough.....PR ?

@filmor
Copy link
Contributor Author

filmor commented Aug 15, 2013

I'm really sorry for the noise here ...
Travis seems to be angry with me for doing so, but locally all tests run successfully.

@jreback
Copy link
Contributor

jreback commented Aug 23, 2013

can you hook up travis?

@filmor
Copy link
Contributor Author

filmor commented Sep 23, 2013

Travis seems to work now, the latest commit is already rebased to master.

To use the fast_union method it is not enough to find an overlap, the
indices also have to be aligned.
@jreback jreback merged commit 3584e50 into pandas-dev:master Sep 26, 2013
@jreback
Copy link
Contributor

jreback commented Sep 26, 2013

@filmor thanks!

@filmor filmor deleted the dt_index_fix branch January 6, 2015 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants