Match List-I with List-II
List-I List-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
Match List-I with List-II
| List-I | List-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 I | List 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.
Related questions:
2025: 21 May Shift 1
2026: 13 May Shift 2
2026: 13 May Shift 2
2026: 23 May Shift 1