Identify the attributes of Pandas Series that assigns a name to the Series 'ser1'.
Identify the attributes of Pandas Series that assigns a name to the Series 'ser1'.
Solution
✅ Correct Option: 1
The name attribute of a Pandas Series object gives the Series its name. For the Series ser1, it is set and read as ser1.name, for example ser1.name = 'Marks'. The name also becomes the column name when the Series is placed in a DataFrame.
Option 2: ser1.index.name names the index of the Series, not the Series itself.
Option 3: Series.name is written on the class, not on the object ser1, so it does not name this particular Series.
Related questions:
2025: 27 May Shift 2
2026: 26 May Shift 1
2025: 30 May Shift 2