Skip to main contentSkip to solution

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.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question