I am trying to create a dictionary from a csv file. The first column of the csv file contains unique keys and the second column contains values. Each row of the csv file rep
One-liner solution
import pandas as pd dict = {row[0] : row[1] for _, row in pd.read_csv("file.csv").iterrows()}