I have a data frame in which I have attributes and values for two products.
PRODUCT ATTRIBUTE VALUES
prod1 Attr1 A
prod1 Attr2 B
prod1 Attr3 C
prod1 Attr4 D
prod2 Attr1 E
prod2 Attr2 F
prod2 Attr3 G
prod2 Attr4 H
How can I convert it into a dictionary of a list of dictionaries that looks like the following?
{'prod1':[{'Attr1':A, 'Attr2':B, 'Attr3':C, 'Attr4':D}], 'prod2':[{'Attr1':E, 'Attr2':F, 'Attr3':G, 'Attr4':H}]}