Skip to content

Instantly share code, notes, and snippets.

@casperghst42
Created October 8, 2025 10:44
Show Gist options
  • Select an option

  • Save casperghst42/7e748e5f2373aee5ca4543df865fa64d to your computer and use it in GitHub Desktop.

Select an option

Save casperghst42/7e748e5f2373aee5ca4543df865fa64d to your computer and use it in GitHub Desktop.
Python: reading CSV into a dict
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