Q. Which method stacks the prescribed level(s) from columns to index?

  • (A) stack()
  • (B) unstack()
  • (C) melt()
  • (D) pivot()
πŸ’¬ Discuss
βœ… Correct Answer: (A) stack()
Explanation: stack() pivots the columns of a DataFrame into the index, compressing it into a Series with a MultiIndex.
Explanation by: Sikhar Chaudhary
stack() pivots the columns of a DataFrame into the index, compressing it into a Series with a MultiIndex.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
82
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Sikhar Chaudhary
Publisher
πŸ“ˆ
92%
Success Rate