I'm trying to select a row in Pandas DatFrame where a column has the lowest value. There should have an easy way of doing that, but so far I didn't find.
Suppose this dataframe:
>>> print(df.head())
N M S
0 10 42 4
1 39 22 2
2 11 52 4
3 97 42 2
4 66 72 1
How do I get the row where a column has the minimum value? For example, how do I get the row where column 'S' has value 1?
df[df.S==df.S.min()]