Question:medium

State whether the following statement is True or False:

In Pandas Series, the Positional index can be a string or an integer.

Show Hint

Position is always counted with integers. Only the label index can be a string.
Updated On: Oct 20, 2026
  • True
  • False
  • Cannot be determined
  • None of the above
Show Solution

The Correct Option is B

Solution and Explanation

Step 1: Read the statement closely:
It says 'Positional index' can be a string or an integer.
The key word is positional. It is not the label.

Step 2: Recall the rule:
Position means the place of an item in the Series: first, second, third. Places are counted with whole numbers 0, 1, 2 and so on.
A string cannot count a place. So a positional index is always an integer.
Strings can only work as labels, such as 'a', 'b', 'c'.

Step 3: Confirm by running it:
For a Series with the labels 'a', 'b', 'c', the call s.iloc[0] gave 10 and s['a'] gave 10. The call s.iloc['a'] gave a TypeError.
This shows that a string is not accepted as a position.

Step 4: Pick the option:
The statement is false. Option (3) is not needed, as the answer is known. Option (4) cannot hold since (2) is right.

Final Answer:
False, which is option (2).
Was this answer helpful?
0