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

pd.Series(dti) shares data with dti --> DatetimeIndex mutated #21907

Closed
jbrockmendel opened this issue Jul 14, 2018 · 2 comments · Fixed by #24096
Closed

pd.Series(dti) shares data with dti --> DatetimeIndex mutated #21907

jbrockmendel opened this issue Jul 14, 2018 · 2 comments · Fixed by #24096
Labels
Bug Timezones Timezone data dtype
Milestone

Comments

@jbrockmendel
Copy link
Member

Appears to be specific to tz-aware

dti = pd.date_range('2016-01-01', periods=10, tz='US/Pacific')
ser = pd.Series(dti)
ser[::3] = pd.NaT

>>> dti
DatetimeIndex([                      'NaT', '2016-01-02 00:00:00-08:00',
               '2016-01-03 00:00:00-08:00',                       'NaT',
               '2016-01-05 00:00:00-08:00', '2016-01-06 00:00:00-08:00',
                                     'NaT', '2016-01-08 00:00:00-08:00',
               '2016-01-09 00:00:00-08:00',                       'NaT'],
              dtype='datetime64[ns, US/Pacific]', freq='D')
@jbrockmendel
Copy link
Member Author

The problem is not prevented by passing copy=True to pd.Series

@mroeschke
Copy link
Member

This may be partially similar to #6326?

@jschendel jschendel added Bug Timezones Timezone data dtype labels Jul 15, 2018
@jschendel jschendel added this to the Contributions Welcome milestone Jul 15, 2018
makbigc added a commit to makbigc/pandas that referenced this issue Jul 29, 2018
makbigc added a commit to makbigc/pandas that referenced this issue Nov 11, 2018
makbigc added a commit to makbigc/pandas that referenced this issue Nov 18, 2018
@jreback jreback modified the milestones: Contributions Welcome, 0.24.0 Dec 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Timezones Timezone data dtype
Projects
None yet
4 participants