The CSV file that I want to read does not fit into main memory. How can I read a few (~10K) random lines of it and do some simple statistics on the selected data frame?
Let's say that you want to load a 20% sample of the dataset:
import pandas as pd df = pd.read_csv(filepath).sample(frac = 0.20)