Sort Pandas dataframe and print highest n values
I think you can use nlargest
(New in pandas
version 0.17.0
):
print df 0 Bytes Client Ip0 1 1 1000 192.168.10.21 0 0 2000 192.168.10.122 2 2 500 192.168.10.43 3 3 159 192.168.10.56print df.nlargest(3, 'Client') 0 Bytes Client Ip1 0 0 2000 192.168.10.120 1 1 1000 192.168.10.22 2 2 500 192.168.10.4