-
-
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
BUG: Assignment of Timestamp Scalar uses micrsosecond precision, Series uses nano #55487
Comments
I just ran into a similar issue:
Question: which resulting dtypes do df1 and df2 have? Answer:
...and the resulting DFs are incompatible, cannot be concatenated because of incompatible dtypes! I think it boils down to |
Hello @WillAyd, I would love to work on this. I have found that the issue is that the direct assignment passes through the To recap, the direct assignment follows this call trace to the problem : I am just beginning in this kind of open source work, so please do not hesitate to give me any kind of guidance. Also, I would be very happy to work on the problem if you would have any specific guidelines. Thank you |
@davetapley How is |
@ValueRaider I'm not sure I follow? It is literally a pandas/pandas/_libs/tslibs/timestamps.pyi Line 34 in dc37a6d
i.e.: >>> import pandas as pd
>>> from datetime import datetime
>>> isinstance(pd.Timestamp.now(), datetime)
True R.e. my specific linking of #55014 as a possible dupe,
|
@davetapley It does appear similar, but my concern is that thread is handling bug as a low-priority edge case: That this happens using pure Pandas API should raise the urgency. |
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
yields
Issue Description
I was surprised to see the dtype mismatch here
Expected Behavior
At least for backwards compatability we might want to still make the scalar assignment still yield nanosecond resolution
Installed Versions
INSTALLED VERSIONS
commit : c2cd90a
python : 3.10.12.final.0
python-bits : 64
OS : Linux
OS-release : 6.2.0-33-generic
Version : #33-Ubuntu SMP PREEMPT_DYNAMIC Tue Sep 5 14:49:19 UTC 2023
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 2.2.0dev0+341.gc2cd90ac54
numpy : 1.24.4
pytz : 2023.3.post1
dateutil : 2.8.2
setuptools : 68.0.0
pip : 23.2.1
Cython : 0.29.33
pytest : 7.4.2
hypothesis : 6.87.1
sphinx : 7.2.6
blosc : None
feather : None
xlsxwriter : 3.1.6
lxml.etree : 4.9.3
html5lib : 1.1
pymysql : 1.4.6
psycopg2 : 2.9.7
jinja2 : 3.1.2
IPython : 8.16.1
pandas_datareader : None
bs4 : 4.12.2
bottleneck : 1.3.7
dataframe-api-compat: None
fastparquet : 2023.8.0
fsspec : 2023.9.2
gcsfs : 2023.9.2
matplotlib : 3.7.3
numba : 0.57.1
numexpr : 2.8.7
odfpy : None
openpyxl : 3.1.2
pandas_gbq : None
pyarrow : 13.0.0
pyreadstat : 1.2.3
python-calamine : None
pyxlsb : 1.0.10
s3fs : 2023.9.2
scipy : 1.11.3
sqlalchemy : 2.0.21
tables : 3.8.0
tabulate : 0.9.0
xarray : 2023.9.0
xlrd : 2.0.1
zstandard : 0.21.0
tzdata : 2023.3
qtpy : None
pyqt5 : None
The text was updated successfully, but these errors were encountered: