-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: DatetimeProperties
results seem to be inconsistent since missing milliseconds
#49073
Comments
Going to restructure this issue as an enhancement request since this stems from Also if pandas supports |
DatetimeProperties
results seem to be inconsistentDatetimeProperties
results seem to be inconsistent since missing milliseconds
take |
If I've understood correctly, I think I'd be -1 on adding milliseconds Suppose one had
Then one might well expect to get
This could be resolved by making To minimise surprises to users, I'd advocate for staying consistent with the Python standard library:
|
closing for now then, but thanks for the suggestion! |
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
When
second
&nanosecond
are being accessed, the results being returned are consistent with expectations i.e., only thesecond
&nanosecond
components of the times. But whenmicrosecond
is accessed, a result of combiningmillisecond
µsecond
are being returned. This doesn't seem to be consistent with the way other properties return their results.This is also a Feature request to have the
millisecond
property added toDatetimeProperties
.Expected Behavior
Installed Versions
In [38]: pd.show_versions()
/nvme/0/pgali/envs/cudfdev/lib/python3.9/site-packages/_distutils_hack/init.py:33: UserWarning: Setuptools is replacing distutils.
warnings.warn("Setuptools is replacing distutils.")
INSTALLED VERSIONS
commit : 87cfe4e
python : 3.9.13.final.0
python-bits : 64
OS : Linux
OS-release : 4.15.0-76-generic
Version : #86-Ubuntu SMP Fri Jan 17 17:24:28 UTC 2020
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.5.0
numpy : 1.23.3
pytz : 2022.4
dateutil : 2.8.2
setuptools : 65.4.1
pip : 22.2.2
Cython : 0.29.32
pytest : 7.1.3
hypothesis : 6.56.2
sphinx : 5.2.3
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.2
IPython : 8.5.0
pandas_datareader: None
bs4 : 4.11.1
bottleneck : None
brotli :
fastparquet : None
fsspec : 2022.8.2
gcsfs : None
matplotlib : None
numba : 0.56.2
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 9.0.0
pyreadstat : None
pyxlsb : None
s3fs : 2022.8.2
scipy : 1.9.1
snappy :
sqlalchemy : 1.4.41
tables : None
tabulate : 0.9.0
xarray : None
xlrd : None
xlwt : None
zstandard : None
tzdata : None
The text was updated successfully, but these errors were encountered: