How to create DataFrame from dictionary in Python-Pandas? - GeeksforGeeks

PHOTO EMBED

Sun Jul 10 2022 09:04:48 GMT+0000 (Coordinated Universal Time)

Saved by @nilotpalc #python

# import pandas library
import pandas as pd
  
# dictionary with list object in values
details = {
    'Name' : ['Ankit', 'Aishwarya', 'Shaurya', 'Shivangi'],
    'Age' : [23, 21, 22, 21],
    'University' : ['BHU', 'JNU', 'DU', 'BHU'],
}
  
# creating a Dataframe object 
df = pd.DataFrame(details)
  
df
content_copyCOPY

https://www.geeksforgeeks.org/how-to-create-dataframe-from-dictionary-in-python-pandas/