Skip to content
Advertisement

Create pandas dataframe from multiple sources

I need to create a pandas dataframe using information from two different sources. For example,

JavaScript

The first 3 columns in the dataframe I want should contain c1, c2, c3, and the rest of the columns come from the key of the returnedDict. The number of keys in the returnedDict is 100. How can I initialize such Dataframe and append the row in the dataframe at each for loop?

Expected output

JavaScript

Advertisement

Answer

If my understanding of your question is correct, here is an example of how to do it (Python >= 3.9.0):

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