A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/8411 below:

using .dt.tz_localize('UTC') returns a tz-unaware object · Issue #8411 · pandas-dev/pandas · GitHub

In [48]: s
Out[48]: 
0    1411161507178
1    1411138436009
2    1411123732180
3    1411167606146
4    1411124780140
5    1411159331327
6    1411131745474
7    1411151831454
8    1411152487758
9    1411137160544
Name: 1, dtype: int64

In [49]: pd.DatetimeIndex(pd.to_datetime(s,unit='ms')).tz_localize('UTC').tz_convert('US/Eastern')
Out[49]: 
<class 'pandas.tseries.index.DatetimeIndex'>
[2014-09-19 17:18:27.178000-04:00, ..., 2014-09-19 10:32:40.544000-04:00]
Length: 10, Freq: None, Timezone: US/Eastern

Which should be equivalent to

In [50]: pd.to_datetime(s,unit='ms').dt.tz_localize('UTC').dt.tz_convert('US/Eastern')
TypeError: Cannot convert tz-naive timestamps, use tz_localize to localize

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4