BUG: pd.Series.dt.end_time when values are pd.Period objects are producing different results · Issue #17157 · pandas-dev/pandas (original) (raw)
From this SO post
Code Sample, a copy-pastable example if possible
import pandas as pd
s = pd.Series(pd.to_datetime(['2010-08-05'])) sp = s.dt.to_period('M') sp.iloc[0].end_time == sp.dt.end_time.iloc[0]
Problem description
In the above code, I compare two ways in which I expected to get the same exact value. It seems that when I use sp.dt.end_time
I get the final date of the period but with time set to zeros. If I use sp.iloc[0].end_time
I get what I expected, which is the final date and time set to '23:59:59.999999999'
Expected Output
Output of pd.show_versions()
[paste the output of pd.show_versions()
here below this line]
INSTALLED VERSIONS
commit: None
python: 3.6.0.final.0
python-bits: 64
OS: Darwin
OS-release: 16.6.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
pandas: 0.20.3
pytest: 3.0.5
pip: 9.0.1
setuptools: 36.2.0
Cython: 0.25.2
numpy: 1.13.1
scipy: 0.18.1
xarray: 0.9.5
IPython: 5.1.0
sphinx: 1.5.1
patsy: 0.4.1
dateutil: 2.6.1
pytz: 2017.2
blosc: None
bottleneck: 1.2.0
tables: 3.3.0
numexpr: 2.6.1
feather: 0.4.0
matplotlib: 2.0.0
openpyxl: 2.4.1
xlrd: 1.0.0
xlwt: 1.2.0
xlsxwriter: 0.9.6
lxml: 3.7.2
bs4: 4.5.3
html5lib: 0.9999999
sqlalchemy: 1.1.5
pymysql: None
psycopg2: None
jinja2: 2.9.4
s3fs: None
pandas_gbq: None
pandas_datareader: 0.4.0