Question:medium

In the context of creating a Pandas Series from a dictionary, which of the following statement is correct?

Show Hint

A dictionary key names an item, just like an index label in a Series. Match keys and values to the parts of the Series.
Updated On: Oct 20, 2026
  • The values of the dictionary become the indices of the Series.
  • The keys of the dictionary become the values of the Series.
  • The keys of the dictionary become the indices of the Series.
  • The Series will have default integer indices starting from 0, ignoring the dictionary keys.
Show Solution

The Correct Option is C

Solution and Explanation

Step 1: Compare a dictionary with a Series:
A dictionary stores pairs of key and value. A Series stores pairs of index label and value.
A key and an index label play the same role: both name an item.

Step 2: Map the parts:
Key goes to index label. Value goes to data value.
For example, {'Mon': 5, 'Tue': 7} becomes a Series with the labels Mon and Tue and the data 5 and 7.

Step 3: Remove the wrong options:
Options 1 and 2 swap the roles of key and value, so both are wrong.
Option 4 talks about default numbers from 0. Pandas gives these numbers only when no labels are supplied, as with a plain list. A dictionary already supplies labels, so option 4 is wrong.

Final Answer:
Option 3 is correct because the dictionary keys become the Series indices.
Was this answer helpful?
0