Call unique() on a timezone aware datetime series returns non timezone aware result · Issue #13565 · pandas-dev/pandas (original) (raw)

Call unique() on a timezone aware datetime series returns non timezone aware result.

Code Sample

import pandas as pd
import pytz
import datetime

In [242]: ts = pd.Series([datetime.datetime(2011,2,11,20,0,0,0,pytz.utc), datetime.datetime(2011,2,11,20,0,0,0,pytz.utc), datetime.datetime(2011,2,11,21,0,0,0,pytz.utc)])

In [243]: ts
Out[243]:
0 2011-02-11 20:00:00+00:00
1 2011-02-11 20:00:00+00:00
2 2011-02-11 21:00:00+00:00
dtype: datetime64[ns, UTC]

In [244]: ts.unique()
Out[244]: array(['2011-02-11T20:00:00.000000000', '2011-02-11T21:00:00.000000000'], dtype='datetime64[ns]')

output of pd.show_versions()

INSTALLED VERSIONS

commit: None
python: 2.7.9.final.0
python-bits: 64
OS: Linux
OS-release: 3.16.0-4-amd64
machine: x86_64
processor:
byteorder: little
LC_ALL: None
LANG: de_AT.UTF-8

pandas: 0.18.1
nose: 1.3.4
pip: 8.1.2
setuptools: 22.0.5
Cython: 0.21.1
numpy: 1.11.0
scipy: 0.14.0
statsmodels: None
xarray: None
IPython: 4.2.0
sphinx: 1.2.3
patsy: None
dateutil: 2.5.3
pytz: 2016.4
blosc: None
bottleneck: None
tables: 3.1.1
numexpr: 2.4
matplotlib: 1.4.2
openpyxl: 2.3.5
xlrd: 0.9.2
xlwt: 0.7.4
xlsxwriter: None
lxml: 3.6.0
bs4: None
html5lib: 1.0b3
httplib2: 0.9
apiclient: None
sqlalchemy: 0.9.8
pymysql: None
psycopg2: None
jinja2: 2.7.3
boto: None
pandas_datareader: None