'How to load certain portion of file into memory and write it on a file in Python?

I have a csv file which generates dataframe for every second and stores it in it. It will have millions of values. How to load only certain part. Like only first 5 MB. Then next 5 MB in a text file.. How to load certain portion of file in memory and write it in text file?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source