Which statements about Pandas 'Series' are TRUE?
A. A Series can have duplicate index labels.
B. The data in a Series must be homogeneous.
C. A Series cannot contain NaN values.
D. The index can be of any data type.
Which statements about Pandas 'Series' are TRUE?
A. A Series can have duplicate index labels.
B. The data in a Series must be homogeneous.
C. A Series cannot contain NaN values.
D. The index can be of any data type.
Solution
A: True. Index labels in a Series need not be unique, e.g. pd.Series([1, 2, 3], index=['a', 'a', 'b']) works.
B: True. A Series stores its data under a single dtype. Mixed values are all converted to one common type (for example object).
D: True. The index can hold integers, strings, dates and other hashable types.
C: False. A Series can hold NaN, which is how pandas represents missing data. Functions like isna(), fillna() and dropna() exist for this reason.
Related questions:
2026: 29 May Shift 2
2025: 20 May Shift 1
2026: 31 May Shift 1