Q. Which pandas method reshapes a DataFrame by pivoting the index and columns?

  • (A) pivot()
  • (B) pivot_table()
  • (C) melt()
  • (D) stack()
πŸ’¬ Discuss
βœ… Correct Answer: (A) pivot()
Explanation: The pivot() method reshapes data by turning unique values from a column into new columns.
Explanation by: Sikhar Chaudhary
The pivot() method reshapes data by turning unique values from a column into new columns.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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