Sunday, 3 July 2022

Create a data frame for examination result and display row labels, column labels data types of each column and the dimensions.

 


















import pandas as pd

result_data= {

    'Eng':[90,85,72,69,86],

    'Phy':[85,82,73,56,96],

    'Chem':[88,65,70,36,35],

    'Maths':[90,56,45,36,42],

    'Comp Sci':[85,85,65,23,66],

    'Marks':[406,450,390,480,450],

    'Percentage':[96.5,85.2,48,79,68]

    }

result_df=pd.DataFrame(result_data,

        index=["Amit","Soham","Mohan","Neha","Sachin"])

print(result_df)

print(result_df.index)

print(result_df.column)

print(result_df.dtypes)

print(result_df.ndim)

print(result_df.size)

print(result_df.shape)

print(result_df.T)