How can I find the index of the 3 smallest and 3 largest values in a column in my pandas dataframe? I saw ways to find max and min, but none to get the 3.
You want to take a look at argsort (in numpy and in pandas)
df = pd.DataFrame(np.random.randint(1,100,100).reshape(10,10))
# bottom three indexes
df[0].argsort().values[:3]
# top three indexes
df[0].argsort().values[-3:]