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

前端 未结 5 1716
我在风中等你
我在风中等你 2020-12-23 22:34

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 sm

5条回答
  •  半阙折子戏
    2020-12-23 22:58

    See the Python docs on file objects (the object returned by open(filename) - you can choose to read a specified number of bytes, or use readline to work through one line at a time.

提交回复
热议问题