Skip to content
Advertisement

How to append a dictionary with multiple keys to a dataframe

I am trying to append a dictionary to my DataFrame.

This is how the DataFrame looks:

JavaScript

And this is the dictionary:

JavaScript

I need to append this dictionary to my df. I know how to do it when I append one column (using map) but this is not going to work here.

Any ideas on how to append this?

Advertisement

Answer

You can use the merge() method from Pandas dataframes. You can do something like that :

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement