Asked about Generators and working with large data

How would you process a file larger than your available RAM?

An answer that works

Loop over the file object rather than calling read or readlines, so it yields one line at a time. Wrap it in a generator if you need to transform the records, and batch it if the next step wants groups.

Reading an answer is not being able to give one. The section that teaches this is Generators and working with large data, 3 hours of Python.

Learn this properly