python pandas 3 smallest & 3 largest values

dataframe, pandas, python

Solution

What have you tried? You could sort with `s.sort()` and then call `s.head(3).index` and `s.tail(3).index`.

Problem

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.

Original source