Skip to content

Commit

Permalink
Use iloc instead of take
Browse files Browse the repository at this point in the history
  • Loading branch information
Roger Thomas committed Mar 30, 2017
1 parent 739704e commit f070082
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pandas/core/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ def select_n_frame(frame, columns, n, method, keep):
inds = series.argsort()[::-1][:n]
else:
inds = series.argsort()[:n]
values = series.take(inds)
values = series.iloc[inds]
if i != len(columns) - 1 and values.duplicated().any():
# This series has duplicate values => we must consider all rows in
# frame that match `values`
Expand Down

0 comments on commit f070082

Please sign in to comment.