Answers for "python remove duplicate from dictionary"

0

create dictionary without removing duplicates from dataframe

df.groupby(level=0).apply(lambda x: x.to_dict('r')).to_dict()
# {'bob': [{'age': 20, 'name': 'bob'}, {'age': 30, 'name': 'bob'}],
#  'jim': [{'age': 25, 'name': 'jim'}]}
Posted by: Guest on November-25-2020

Code answers related to "python remove duplicate from dictionary"

Python Answers by Framework

Browse Popular Code Answers by Language