How to convert a dataframe to a dictionary

If lakes is your DataFrame, you can do something like

area_dict = dict(zip(lakes.id, lakes.value))

Leave a Comment