Data frame in Pandas has a method which takes a column name (for a regular index) or
Data frame in Pandas has a method which takes a column name (for a regular index) or
a list of column names to create a new, re-indexed data frame, which of the following
is correct method?
Show answerHide answer
Correct answer: (C) set_index ( )
Explanation
set_index() takes a column name or list of column names and returns a new DataFrame indexed by those columns.