Feature Type
-
[X] Adding new functionality to pandas
-
[ ] Changing existing functionality in pandas
-
[ ] Removing existing functionality in pandas
Problem Description
When the pd.read_excel function encounters an empty cell with a numeric dtype, it leads to a conversion error. The solution to this, is to use the Pandas specific nullable numeric types, which work extremely well. The problem is that these datatypes are hard to access via strings. pd.read_excel is especially keen on interpreting strings as numpy datatypes, while pd.api.types.pandas_dtype is capable of returning pandas dtypes, but it's unclear what this is based on.
Feature Description
Since the pandas dtypes often have several advantages over their numpy counterparts, it would make sense that functions which are capable of interpreting strings as datatypes have a flag, which forces them (if possible) to interpret strings as pandas datatypes and not their numpy counterparts.
Alternative Solutions
A workaround for now, is to run every datatype through the pd.api.types.pandas_dtype function, with very specific capitalization.
Running:
type(pd.api.types.pandas_dtype("Int64"))
Returns:
Additional Context
No response
Comment From: rhshadrach
Thanks for the report, does specifying pd.options.future.infer_string = True
do the trick?
See https://pandas.pydata.org/pdeps/0014-string-dtype.html for more details.
Comment From: mroeschke
Closing as this appears to need more context to be actionable