-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Nlargest on boolean return False first #26154
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
Milestone
Comments
Makes sense. Investigation and PRs are always welcome |
This is interesting. Let me take a look. |
Looks similar to closed issue #21426. Had a quick today but didn't have time to fix. |
@bpieper26 Thanks for pointing out. The problem is that a boolean array is converted to a uint array. |
4 tasks
Thanks for your help :) |
My pleasure! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Code Sample, a copy-pastable example if possible
Problem description
If you cast this to any other type, you will have the opposite and expected order.
More generally in python
True > False
. You still have the same order everywhere in pandas.The result is misleading and can easily lead to a debugging process.
Expected Output
Output of
pd.show_versions()
[paste the output of
pd.show_versions()
here below this line]INSTALLED VERSIONS
commit: None
python: 3.6.7.final.0
python-bits: 64
OS: Linux
OS-release: 4.4.0-17763-Microsoft
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: C.UTF-8
LOCALE: en_US.UTF-8
pandas: 0.24.2
pytest: None
pip: 9.0.1
setuptools: 40.6.3
Cython: 0.26.1
numpy: 1.16.2
scipy: 1.1.0
pyarrow: None
xarray: None
IPython: None
sphinx: None
patsy: 0.5.0
dateutil: 2.8.0
pytz: 2019.1
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: 2.2.2
openpyxl: 2.5.8
xlrd: None
xlwt: None
xlsxwriter: 1.1.2
lxml.etree: 4.2.5
bs4: None
html5lib: 0.999999999
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
gcsfs: None
The text was updated successfully, but these errors were encountered: