You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to the issue documented in #36586, if the goal of pd.NA is to provide a missing indicator that can be used across datatypes, it should also work with a float datatype. Currently, if a user attempts to use a pd.NA value in a series with dtype of float, an error is raised: TypeError: float() argument must be a string or a number, not 'NAType'.
This also appears related to the issue mentioned in #36585
FYI @thehomebrewnerd, your "expected output" section isn't possible. pd.NA is not a float, so it can't be stored in a NumPy float64 array. That should raise.
@TomAugspurger I guess I didn't search deep enough to see this was being worked in other issues. In any case, I understand your point. As long as there is a float dtype of some sort that can handle pd.NA, analogous to Int64, that seems fine to me.
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
(optional) I have confirmed this bug exists on the master branch of pandas.
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Code Sample, a copy-pastable example
Problem description
Similar to the issue documented in #36586, if the goal of
pd.NA
is to provide a missing indicator that can be used across datatypes, it should also work with afloat
datatype. Currently, if a user attempts to use apd.NA
value in a series with dtype of float, an error is raised:TypeError: float() argument must be a string or a number, not 'NAType'
.This also appears related to the issue mentioned in #36585
Expected Output
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : f2ca0a2
python : 3.7.4.final.0
python-bits : 64
OS : Darwin
OS-release : 18.7.0
Version : Darwin Kernel Version 18.7.0: Mon Feb 10 21:08:45 PST 2020; root:xnu-4903.278.28~1/RELEASE_X86_64
machine : x86_64
processor : i386
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.1.1
numpy : 1.19.1
pytz : 2020.1
dateutil : 2.8.1
pip : 20.2.2
setuptools : 40.8.0
Cython : None
pytest : 6.0.1
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : None
IPython : None
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None
The text was updated successfully, but these errors were encountered: