English, asked by dhairyashilghadge123, 5 months ago

Write a python code to create a DataFrame from Dict of Series.​

Answers

Answered by Anonymous
6

Answer:

Create DataFrame from Dictionary using default Constructor of pandas.Dataframe class.

Code:

# 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

Similar questions