How To Create a DataFrame From a list of Dictionary?
Create a DataFrame From list of Dictionary
We can
create the
DataFrame, passing
the Dictionary
as an argument
to the
DataFrame. It is very easy to create
a DataFrame from a list of Dictionary.
Example 1:
Lets take an example
to create a DataFrame to pass the dictionary as an argument.
import numpy as np
import
pandas
as pd
dict =
{
'names'['Ankita','Subrat','Sarthak','Partha'],
'physics':
[68, 74, 77, 78],
'chemistry':
[84, 56, 73, 69],
'IP': [78, 88, 82, 87]}
#create dataframe using dictionary
df = pd.DataFrame(dict)
print(df)
Download the PDF to see More Examples:
0 comments:
Post a Comment