1.

Given a data frame df1 as shown below:CityMaxtempMinTempRainFallDelhi403224.1Bengaluru312536.2Chennai352740.8Mumbai292135.2Kolkata392341.8(i) Write command to compute sum of every column of the data frame.(ii) Write command to compute mean of column Rainfall.(iii) Write command to compute average maxTemp, Rainfall for first 5 rows

Answer»

(i)  df1.sum() 

(ii)  df1[‘Rainfall’].mean()

(iii) df1.loc[:11, ‘maxtemp’:’Rainfall’].mean( )



Discussion

No Comment Found

Related InterviewSolutions