CBSE Class 12 Informatics Practices Question 44 of 167

Python Pandas — I — Question 9

Back to all questions
9
Question

Question 9

To display third element of a Series object S, you will write ............... .

  1. S[:3]
  2. S[2]
  3. S[3]
  4. S[:2]
Answer

S[2]

Reason — The syntax to access individual elements of a Series object is <Series Object name>[<valid index>]. Therefore, according to this syntax, to display third element of a Series object S with zero based indexing, S[2] is correct.