Datetime.index.date returns incorrect date post upgrade to version 0.23 · Issue #21230 · pandas-dev/pandas (original) (raw)
Code Sample, a copy-pastable example if possible
df1 = pd.DataFrame(data=[24, 25], index=pd.DatetimeIndex(['2013-01-24 15:01:00+01:00', '2013-01-25 15:01:00+01:00'], dtype='datetime64[ns, CET]', name='Date', freq=None)) print(df1.index.date)
the above code prints:
[datetime.date(2013, 1, 23) datetime.date(2013, 1, 24)]
Problem description
Datetime.index.date does return incorrect dates. The behavious worked until version 0.22, and seems to be incorrect post upgrade to version 0.23
Expected Output
[datetime.date(2013, 1, 24) datetime.date(2013, 1, 25)]
Output of pd.show_versions()
[paste the output of pd.show_versions()
here below this line]
INSTALLED VERSIONS
commit: None
python: 3.6.5.final.0
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: Intel64 Family 6 Model 60 Stepping 3, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: None.None
pandas: 0.23.0
pytest: 3.5.1
pip: 10.0.1
setuptools: 39.1.0
Cython: None
numpy: 1.12.1
scipy: 1.1.0
pyarrow: None
xarray: None
IPython: 6.4.0
sphinx: 1.7.4
patsy: 0.5.0
dateutil: 2.7.3
pytz: 2018.4
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: 2.2.2
openpyxl: None
xlrd: 1.1.0
xlwt: None
xlsxwriter: None
lxml: None
bs4: 4.6.0
html5lib: 1.0.1
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None