-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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: pd.NA is not compatible with searchsorted #30944
Comments
Marked the milestone as 1.0.0 because it'd be nice to fix this before the release but not sure if this should actually be a blocker for the release. |
It would be indeed be nice to at least solve things like Longer term: I don't think it is easy to fix the |
Hi, can I work on this? |
take |
@jschendel Is this issue still occurring? I tried
and the result is
Seems like only
Should I follow what @jorisvandenbossche said and update integer array to float array in |
Yes, this is specifically an issue with I'm a little hesitant to coerce integer array to float array due to the likely performance hits but could maybe be fine for a short-term fix. The |
What needs to be done here for 1.0.0? Just fix the regression in |
possibly related: i tried adding |
xref pandas-dev#30944. I think this doesn't close it, since only the pd.cut compoment is fixed.
xref pandas-dev#30944. I think this doesn't close it, since only the pd.cut compoment is fixed.
I'm going to move this off 1.0.0, I think that The fix for |
Code Sample, a copy-pastable example if possible
On
master
trying to usepd.NA
as an input tosearchsorted
fails, and trying to use thesearchsorted
of an array containingpd.NA
also fails:Note that the
np.nan
equivalent works fine:This has downstream effects on anything that relies on
searchsorted
, e.g.pd.cut
, which has the same failing behavior as above forpd.NA
but succeeds fornp.nan
:Problem description
pd.NA
is not compatible withsearchsorted
.Expected Output
I'd expect the output for the
pd.NA
operations above to match the output of the equivalentnp.nan
operations.Output of
pd.show_versions()
INSTALLED VERSIONS
commit : 4e2546d
python : 3.7.4.final.0
python-bits : 64
OS : Linux
OS-release : 4.19.14-041914-generic
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.0.0rc0+15.g4e2546d89
numpy : 1.17.2
pytz : 2019.2
dateutil : 2.8.0
pip : 19.2.3
setuptools : 41.6.0.post20191030
Cython : 0.29.13
pytest : 5.2.0
hypothesis : 4.36.2
sphinx : 1.8.5
blosc : None
feather : None
xlsxwriter : 1.2.1
lxml.etree : 4.4.1
html5lib : 1.0.1
pymysql : None
psycopg2 : None
jinja2 : 2.10.1
IPython : 7.8.0
pandas_datareader: None
bs4 : 4.8.0
bottleneck : 1.2.1
fastparquet : 0.3.2
gcsfs : None
lxml.etree : 4.4.1
matplotlib : 3.1.1
numexpr : 2.7.0
odfpy : None
openpyxl : 3.0.0
pandas_gbq : None
pyarrow : 0.15.0
pytables : None
pytest : 5.2.0
s3fs : 0.3.4
scipy : 1.3.1
sqlalchemy : 1.3.8
tables : 3.5.1
tabulate : None
xarray : 0.13.0
xlrd : 1.2.0
xlwt : 1.3.0
xlsxwriter : 1.2.1
numba : 0.46.0
The text was updated successfully, but these errors were encountered: