πŸ“Š Pandas
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

πŸ‘οΈ
55
Total Visits
πŸ“½οΈ
8 mo ago
Published
πŸŽ–οΈ
Sikhar Chaudhary
Publisher
πŸ“ˆ
85%
Success Rate