You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you try to add a list of timedelta to a column that is datetime the behavior changes if the tzinfo is coming from datetime.tz.tzlocal(). In the example below I make two columns of timestamps, on with tz.tzlocal() and the other tz.tzutc() and then try to add a list of timedelta to it. The tzutc() ones behave as expected but the ones with tzloca() only the first row does the addition properly and for the rest the addition is done to unix epoch of 0!
A small, complete example of the issue
When you try to add a list of timedelta to a column that is datetime the behavior changes if the tzinfo is coming from datetime.tz.tzlocal(). In the example below I make two columns of timestamps, on with tz.tzlocal() and the other tz.tzutc() and then try to add a list of timedelta to it. The tzutc() ones behave as expected but the ones with tzloca() only the first row does the addition properly and for the rest the addition is done to unix epoch of 0!
Expected Output
0 2013-09-20 13:00:00-07:00 2013-09-20 13:00:00+00:00
1 2013-09-20 14:40:00-07:00 2013-09-20 14:40:00+00:00
2 2013-09-20 16:20:00-07:00 2013-09-20 16:20:00+00:00
3 2013-09-20 18:00:00-07:00 2013-09-20 18:00:00+00:00
4 2013-09-20 19:40:00-07:00 2013-09-20 19:40:00+00:00
5 2013-09-20 21:20:00-07:00 2013-09-20 21:20:00+00:00
6 2013-09-20 23:00:00-07:00 2013-09-20 23:00:00+00:00
7 2013-09-21 00:40:00-07:00 2013-09-21 00:40:00+00:00
8 2013-09-21 02:20:00-07:00 2013-09-21 02:20:00+00:00
9 2013-09-21 04:00:00-07:00 2013-09-21 04:00:00+00:00
0 2013-09-20 13:00:00-07:00 2013-09-20 13:00:00+00:00
1 2013-09-20 13:00:01-07:00 2013-09-20 14:40:01+00:00
2 2013-09-20 13:00:02-07:00 2013-09-20 16:20:02+00:00
3 2013-09-20 13:00:03-07:00 2013-09-20 18:00:03+00:00
4 2013-09-20 13:00:04-07:00 2013-09-20 19:40:04+00:00
5 2013-09-20 13:00:05-07:00 2013-09-20 21:20:05+00:00
6 2013-09-20 13:00:06-07:00 2013-09-20 23:00:06+00:00
7 2013-09-20 13:00:07-07:00 2013-09-21 00:40:07+00:00
8 2013-09-20 13:00:08-07:00 2013-09-21 02:20:08+00:00
9 2013-09-20 13:00:09-07:00 2013-09-21 04:00:09+00:00
Output of
pd.show_versions()
commit: None
python: 2.7.11.final.0
python-bits: 64
OS: Linux
OS-release: 4.7.4-100.fc23.x86_64
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.utf8
pandas: 0.18.1
nose: 1.3.7
pip: 8.1.2
setuptools: 18.0.1
Cython: 0.23.4
numpy: 1.11.1
scipy: 0.17.1
statsmodels: 0.6.1
xarray: None
IPython: 4.1.1
sphinx: 1.2.3
patsy: 0.4.1
dateutil: 2.5.3
pytz: 2016.6.1
blosc: None
bottleneck: 0.6.0
tables: None
numexpr: 2.4.6
matplotlib: 1.5.1
openpyxl: 1.8.6
xlrd: None
xlwt: None
xlsxwriter: None
lxml: 3.4.4
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.12
pymysql: None
psycopg2: 2.6.1 (dt dec pq3 ext lo64)
jinja2: 2.8
boto: 2.41.0
pandas_datareader: None
The text was updated successfully, but these errors were encountered: