-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
assignment with datetime64[ns, UTC] raises TypeError #32395
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
Comments
Thanks for the report. Things look weird around pandas/pandas/core/internals/blocks.py Lines 842 to 857 in f25ed6f
I see a couple options, both of which are likely valuable.
Are you interested in working on this? |
(tagged this as a regression) |
In 0.25 the
I can work on this. |
can confirm this is the cause of the regression, xref #29139 (regression in 1.0.0) 225cc92 is the first bad commit
|
Code Sample
Problem description
If you try to assign datetime values (with zone and indexes) to a column, it will raise TypeError: data type not understood.
No errors raise with index ':', or when the column already has the correct type. Note that this only happens if the datetime has zone information. With tzinfo=None, no errors occur.
Output of
pd.show_versions()
I noticed this bug in version 1.0.1
No errors occur in 0.25.3
INSTALLED VERSIONS
commit : None
pandas : 1.0.1
numpy : 1.16.4
pytz : 2019.1
dateutil : 2.8.0
pip : 20.0.1
setuptools : 45.1.0
Cython : None
pytest : None
hypothesis : None
sphinx : 2.4.2
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : 2.8.2 (dt dec pq3 ext lo64)
jinja2 : 2.10.1
IPython : 7.8.0
pandas_datareader: None
bs4 : 4.8.2
bottleneck : None
fastparquet : None
gcsfs : 0.6.0
lxml.etree : None
matplotlib : 3.1.0
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 0.16.0
pytables : None
pytest : None
pyxlsb : None
s3fs : None
scipy : 1.2.0
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
xlsxwriter : None
numba : None
The text was updated successfully, but these errors were encountered: