Last active
December 9, 2024 23:06
-
-
Save copocaneta/732eb5e413494dca518ab73efdbf4061 to your computer and use it in GitHub Desktop.
Improve this code by optimizing data flow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Loading all lines of a file into memory | |
with open("large_data.txt", "r") as file: | |
lines = file.readlines() | |
for line in lines: | |
# Processing each line | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment