I have a .csv file with one column called Trigger and two other columns called void1 and void2.
The data looks like this:
Trigger;void1;void
good;not good;not to good;
I would like to use this data to create a dictionary that looks like this:
dictionary ={"good":["not good", "not to good"]}
I used the following code to start:
df = pd.read_csv('dictionary.csv', sep =";")
for index, row in df.iterrows():
dictionary[row['trigger']] = row['void1']
Which works. However when I try:
df = pd.read_csv('dictionary.csv', sep =";")
for index, row in df.iterrows():
dictionary[row['trigger']] = row['void1', 'void2']
It doesn't work. Any ideas how I can get the output I am looking for?