0

Given a very large csv file with many rows and 3 columns:

the file is read as following :

import pandas as pd

df = pd.read_csv("test.csv", sep=" ", chunksize=100000)

Now how to get the N largest rows based on the values in the 3rd column when chunkzise is utilized ?

Win
  • 51
  • 5
  • Does this answer your question? [How to get top 5 values from pandas dataframe?](https://stackoverflow.com/questions/47462690/how-to-get-top-5-values-from-pandas-dataframe) – Tomerikoo Sep 09 '21 at 11:57
  • Does this answer your question? [Get first and second highest values in pandas columns](https://stackoverflow.com/q/39066260/6045800) – Tomerikoo Sep 09 '21 at 11:58

1 Answers1

0

Try this:

print(df.nlargest(N, columns=df.columns[2]))
U13-Forward
  • 69,221
  • 14
  • 89
  • 114