I was wondering how I can map a dictionary key with multiple dictionary items. I have tried the below however the output is not the expected one.
d = {'col1': ['type 2','type 3', 'type 4', 'type 5', 'type 6', 'type 6']}
df = pd.DataFrame(data=d)
dict = {
'a' :['type 2', 'type 3'],
'b' : ['type 4', 'type 5'],
'c': ['types 6', 'types 7']
}
for k, v in df.items():
df['col1'].map({k: v})
print(df)
