Reputation: 987
Let's suppose you have a pandas dataframe with col1 and you want to keep only the k samples with the highest value of col1. How can you do that?
Notice I'm not saying maximum value. But rather like sorting by col1, keeping the best k samples, and removing the rest.
Upvotes: 0
Views: 112