Created
September 1, 2023 12:50
-
-
Save grubberr/d3797e29c34977187300b33e638c4dbf to your computer and use it in GitHub Desktop.
csv_a_lot_fields_read.py
This file contains 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
import io | |
import csv | |
data = [] | |
for l in range(10): | |
fields = [] | |
for f in range(1000000): | |
fields.append('"field{}"'.format(f)) | |
fields = ",".join(fields) | |
data.append(fields) | |
data = "\n".join(data) + "\n" | |
buff = io.StringIO(data) | |
reader = csv.reader(buff) | |
for row in reader: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment