Question
Write the statements to create the Series with given dictionary SectionNames as index and Section strength as values. Also answer the questions given below:sectionNames = ['A','B','C','D','E','F']
sectionStrength = [34,50,60,54,45,40]
(a) (i) To print the first 5 records.
(ii) To print the last 3 records.
(iii) To print the sum of the strength using loop.
(b) Write the output of the following:
(i) sections.iloc[4]
(ii) sections.loc['B']
(iii) sections[3]

Answer

(a) sections = pd.Series(sectionStrength,index = sectionNames)(i) sections.head()
(ii) sections.tail(3)

(b) (i) 45
(ii) 50
(iii) 54

Need a full question paper?

Generate a complete, print-ready paper with questions like this in minutes — across 16+ boards, with answer keys.

Start Generating Free