Skip to main contentSkip to solution

Match List-I with List-II

List-IList-II
(A) pivot()(I) reshape data based on column values
(B) melt()(II) convert the wide format data to a long format
(C) set_index()(III) assign column as index
(D) reset_index()(IV) convert index back to column

Solution

✅ Correct Option: 1
List IList II
(A) pivot()(I) reshape data based on column values
(B) melt()(II) convert the wide format data to a long format
(C) set_index()(III) assign column as index
(D) reset_index()(IV) convert index back to column

pivot() and melt() are easily swapped. pivot() turns values of a column into new columns (long to wide), while melt() does the reverse (wide to long).

set_index() and reset_index() are opposites. set_index() moves a column into the index, and reset_index() moves the index back into a column.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question