Question:

In data handling, pandas support index values.

Show Hint

In Pandas, a label can repeat in the index. It does not have to be unique.
Updated On: Oct 1, 2026
  • Unique
  • Non-unique
  • Homogeneous
  • NaN
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation

Step 1: Understanding the Concept:
Every Series or DataFrame in Pandas has an index that labels the rows. We can select data by these labels using loc.

Step 2: Key Fact:
Pandas does not force index labels to be unique. Labels can repeat, and selecting a repeated label returns all rows with that label.

Step 3: Show an example.
pd.Series([1, 2, 3], index=['a', 'a', 'b']) works without any error. The label a appears twice, and s['a'] returns two values. (This was checked by running it in Python.)

Step 4: Check option 1 (Unique).
Pandas allows unique labels, but it does not insist on them. The notable feature is that labels need not be unique. In a dictionary, keys must be unique, and that is the difference. So option 1 is not the best answer.

Step 5: Check option 2 (Non-unique).
Pandas supports index values that are not unique, as the example shows. So option 2 is correct.

Step 6: Check option 3 (Homogeneous).
Homogeneous means of the same type. The index may have mixed labels, and homogeneous data is a property of a NumPy array, not of the index. So option 3 is wrong.

Step 7: Check option 4 (NaN).
A NaN label is possible but odd, and it is not the standard statement about Pandas index values. So option 4 is wrong.

Final Answer:
Pandas supports non-unique index values, which is option 2. \[ \boxed{2} \]
Was this answer helpful?
0
0