How can I split a large file csv file (7GB) in Python

csv, python, split

Solution

You don't need Python to split a csv file. Using your shell:

$ split -l 100 data.csv

Would split `data.csv` in chunks of 100 lines.

Problem

I have a 7GB `csv` file which I'd like to split into smaller chunks, so it is readable and faster for analysis in Python on a notebook. I would like to grab a small set from it, maybe 250MB, so how can I do this?

Original source