-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Closed
Copy link
Labels
BugDatetimeDatetime data dtypeDatetime data dtypeReshapingConcat, Merge/Join, Stack/Unstack, ExplodeConcat, Merge/Join, Stack/Unstack, ExplodeTimezonesTimezone data dtypeTimezone data dtype
Milestone
Description
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
Metadata
Metadata
Assignees
Labels
BugDatetimeDatetime data dtypeDatetime data dtypeReshapingConcat, Merge/Join, Stack/Unstack, ExplodeConcat, Merge/Join, Stack/Unstack, ExplodeTimezonesTimezone data dtypeTimezone data dtype