-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: in _nsorted for frame with duplicated values index #13412
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
Comments
Indeed:
(@Tux1 side note for future reference, it is always nice to provide a small reproducible example when opening an issue) |
Yes I will fix that soon
|
my fix is not very elegant but I don't see any other solution to deal with MultiIndex and duplicated value index |
…3412) Add note to whatsnew
…3412) Add note to whatsnew Add nlargest benchmark
…3412) Add note to whatsnew Add nlargest benchmark Add tests for Series organize nsorted methods pep 8 fixes passed test and pep8
…3412) Add note to whatsnew Add nlargest benchmark Add tests for Series organize nsorted methods pep 8 fixes passed test and pep8 add docstrings
…3412) Add note to whatsnew Add nlargest benchmark Add tests for Series organize nsorted methods pep 8 fixes passed test and pep8 add docstrings add github issue
Sum seems to work fine in .19.2 But with count, it doesn't seem to make sense. The df gets repeated as many times as the "n". Is that a bug or am i doing something wrong ?
|
@shankararul see: #15297 |
(pandas-dev/pandas#13412) using sort_values instead. As a consequence, the normalization hack is no longer required: use raw float values and change the precision when combine'ing.
The function below has been incorrectly implemented. If the frame has an index with duplicated values, you will get a result with more than
n
rows and not properly sorted. Sonsmallest
andnlargest
for DataFrame doesn't return a correct frame in this particular case.The text was updated successfully, but these errors were encountered: