When performance matters
Using Lists when dealing with large dataset is not always the best choice. As the data gets too big it will quickly consume your computer’s memory. That’s when you should consider using Python’s Generators. Let’s say you want to calculcate the sum of 10 000 items: 1 2 3 my_dataset = [i for i in range(10000)] print(sum(my_dataset)) #49995000 This would of course work, but the impact on memory would be very high. We can do the same thing with generators and then compare the sizes. ...