bug in deep copy of Series with timezone-aware datetime entries #11794

Closed
hcontrast opened this Issue Dec 8, 2015 · 0 comments

Comments

Projects
None yet
2 participants
Contributor

hcontrast commented Dec 8, 2015

deep copies of Series with timezone-aware datetimes are shallow in 0.17.1:

In [12]: import pandas as pd
In [13]: pd.__version__
Out[13]: u'0.17.1'

In [14]: ser = pd.Series([pd.Timestamp('2012/01/01', tz='UTC')])
In [15]: ser2 = ser.copy(deep=True)
In [18]: ser2[0] = pd.Timestamp('1999/01/01', tz='UTC')

# unexpected mutation
In [19]: ser
Out[19]: 
0   1999-01-01 00:00:00+00:00
dtype: datetime64[ns, UTC]

jreback added this to the 0.18.0 milestone Dec 8, 2015

@jreback jreback added a commit to jreback/pandas that referenced this issue Dec 8, 2015

@jreback jreback BUG: bug in .copy of datetime tz-aware objects, #11794
Not always deep-copying the underlying impl, which is a DatetimeIndex where
shallow copies are views
2bf9fb5

jreback closed this in #11796 Dec 8, 2015

@jreback jreback added a commit that referenced this issue Dec 8, 2015

@jreback jreback Merge pull request #11796 from jreback/tzcopy
BUG: bug in deep copy of datetime tz-aware objects, #11794
cbf7043
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment