Q. Which method stacks the prescribed level(s) from columns to index?
β
Correct Answer: (A)
stack()
Explanation: stack() pivots the columns of a DataFrame into the index, compressing it into a Series with a MultiIndex.