Create a dataframe for students’ information such name, graduation percentage and age. Display average age of students, average of graduation percentage. And, also describe all basic statistics of data. (Hint: use describe()).
import numpy as np
import scipy.stats as s
import pandas as pd
d={'Name':['Lina','Sakshi','Shruti','Swanand','Pallavi'],'Percentage':[80,79,90,89,92],
'Age':[19,20,20,19,20]}
df=pd.DataFrame(d)
print(df)
print("Average age of student : ",s.tmean(df['Age']).round(2))
print("Average age of student : ",s.tmean(df['Percentage']).round(2))
print(df.describe())
Comments
Post a Comment