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

Inconsistent concat behavior between datetime64[ns] and tz-aware version in 0.17.1 #11693

Closed
brendene opened this issue Nov 24, 2015 · 3 comments
Labels
Bug Datetime Datetime data dtype Reshaping Concat, Merge/Join, Stack/Unstack, Explode Timezones Timezone data dtype
Milestone

Comments

@brendene
Copy link

This edge case appears when concatenating a timezone aware datetime series with another that is filled with only pd.NaT. This works if the second series is only partially filled with pd.NaT. It also works if the second series is another timezone (in that case the resulting Series is timezone unaware).

import pandas as pd
pd.__version__
x = pd.Series( pd.date_range('20151124 08:00', '20151124 09:00', freq = '1h') )
y = pd.Series( pd.date_range('20151124 10:00', '20151124 11:00', freq = '1h') )
pd.concat([x,y]) # Works

y[:] = pd.NaT
pd.concat([x,y]) # Works

x = pd.Series( pd.date_range('20151124 08:00', '20151124 09:00', freq = '1h', tz = "US/Eastern") )
y = pd.Series( pd.date_range('20151124 10:00', '20151124 11:00', freq = '1h', tz = "US/Eastern") )
pd.concat([x,y])

y[0] = pd.NaT
pd.concat([x,y]) # Works

y[:] = pd.NaT
pd.concat([x,y]) # Fails
@jreback
Copy link
Contributor

jreback commented Nov 24, 2015

0.17.1 I c

can u see if this worked prior to 0.17.0?

@brendene
Copy link
Author

This works in 0.16.2, the dtype of timezoned series is object.

@jreback
Copy link
Contributor

jreback commented Nov 25, 2015

hmm, looks like a bug, want to do a pull-request to fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype Reshaping Concat, Merge/Join, Stack/Unstack, Explode Timezones Timezone data dtype
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants