-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
convert_dtypes fails with int and str #32117
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
As far as I can tell pandas/pandas/core/dtypes/cast.py Line 1054 in ac3056f
returns 'mixed-integer' which according to the definition in Line 1250 in ac3056f
is correct. However this pandas/pandas/core/dtypes/cast.py Line 1065 in ac3056f
executes to True and ( pandas/pandas/core/dtypes/cast.py Line 1069 in ac3056f
sets the 'inferred_dtype' to "Int64" which I think is wrong Hope this helps |
Yes, for this case taking "mixed-integer" as integer is indeed wrong: pandas/pandas/core/dtypes/cast.py Lines 1065 to 1068 in ac3056f
@Dr-Irv do you remember for which use case mixed-integer is needed? |
And thanks for the report, @pjadzinsky ! |
I think this is just my mistake in understanding the meaning of |
Code Sample, a copy-pastable example if possible
Thanks for an amazing package and maintaining it
Problem description
Example raises an error, when it shouldn't. I think the case is missing from the tests
Note: We receive a lot of issues on our GitHub tracker, so it is very possible that your issue has been posted before. Please check first before submitting so that we do not have to handle and close duplicates!
Note: Many problems can be resolved by simply upgrading
pandas
to the latest version. Before submitting, please check if that solution works for you. If possible, you may want to check ifmaster
addresses this issue, but that is not necessary.For documentation-related issues, you can check the latest versions of the docs on
master
here:https://pandas-docs.github.io/pandas-docs-travis/
If the issue has not been resolved there, go ahead and file it in the issue tracker.
Expected Output
series with object dtype ?
Output of
pd.show_versions()
[paste the output of
pd.show_versions()
here below this line]In [6]: pd.show_versions()
INSTALLED VERSIONS
commit : None
python : 3.7.6.final.0
python-bits : 64
OS : Darwin
OS-release : 19.2.0
machine : x86_64
processor : i386
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.0.1
numpy : 1.18.1
pytz : 2019.3
dateutil : 2.8.1
pip : 20.0.2
setuptools : 45.2.0
Cython : None
pytest : 5.3.5
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.11.1
IPython : 7.12.0
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 0.16.0
pytables : None
pytest : 5.3.5
pyxlsb : None
s3fs : 0.4.0
scipy : 1.4.1
sqlalchemy : 1.3.13
tables : None
tabulate : 0.8.6
xarray : None
xlrd : None
xlwt : None
xlsxwriter : None
numba : None
The text was updated successfully, but these errors were encountered: