BUG: nlargest returns empty frame with NA + duplicates #45050
Labels
Algos
Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff
Bug
Duplicate Report
Duplicate issue or pull request
Missing-data
np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
NA - MaskedArrays
Related to pd.NA and nullable extension arrays
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the master branch of pandas.
Reproducible Example
Issue Description
The returned DataFrame is empty while it should have one row when rows having NA are duplicated.
Expected Behavior
The first row should be returned, as when the row with NA is not duplicated.
Installed Versions
INSTALLED VERSIONS
commit : 66e3805
python : 3.7.6.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.19041
machine : AMD64
processor : Intel64 Family 6 Model 142 Stepping 11, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : None.None
pandas : 1.3.5
numpy : 1.19.5
pytz : 2020.1
dateutil : 2.8.1
pip : 20.2.2
setuptools : 49.4.0.post20200813
Cython : None
pytest : None
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
pyxlsb : None
s3fs : None
scipy : 1.6.0
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : 0.52.0
The text was updated successfully, but these errors were encountered: