Created
October 8, 2025 10:44
-
-
Save casperghst42/7e748e5f2373aee5ca4543df865fa64d to your computer and use it in GitHub Desktop.
Python: reading CSV into a dict
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
| import csv | |
| with open('myfile.csv', mode='r', encoding='utf-8-sig') as file | |
| reader = csv.DictReader(file, delimiter=',') | |
| data = list(reader) | |
| row = [ j for j in data if j['column'] == needle ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment