Month: September 2022

Class12thCBSEIP

CREATE A DATAFRAME RESULTDF

CREATE A DATAFRAME RESULTDF Solution:- import pandas as pddata = {‘Arnab’:[90,91,97,95],“Ramit”:[92,81,96,86],“Samridhi”:[89,91,88,95],“Riya”:[81,71,67,80],“Mallika”:[94,95,99,95]}sub =[‘Maths’,’Science’,’Hindi’,’English’]Result=pd.DataFrame(data,sub)print(Result)Result.rename(index={‘Maths’:’Mathematics’,’Science’:’Ssc’},inplace=True)Result.rename(columns={‘Samridhi’:’Sam’,”Mallika”:”Radhka”},inplace=True)print(Result) Output

Read more
Class12thCBSEIP

CREATE A DATAFRAME RESULTDF

CREATE A DATAFRAME RESULTDF, CONTAINS   Solution:- import pandas as pddata={‘Arnab’:[90,91,97,95],‘Ramit’:[92,81,96,86],“Sam”:[89,91,88,95],‘Ram’:[81,71,67,80],“Mohan”:[78,98,68,69]}sub = [‘Maths’,’Science’,”Hindi”,”English”]Result=pd.DataFrame(data,sub)print(Result)del Result[“Ram”]del Result[“Mohan”]Result.drop([“Hindi”])print(Result)

Read more