Match the following DataFrame methods with their description:
List-I List-II (A) add() (I) change data type of a column (B) drop_duplicates() (II) add value along a row or column (C) GROUP BY() (III) group data based on column (D) stype() (IV) remove duplicate rows
Match the following DataFrame methods with their description:
| List-I | List-II |
|---|---|
| (A) add() | (I) change data type of a column |
| (B) drop_duplicates() | (II) add value along a row or column |
| (C) GROUP BY() | (III) group data based on column |
| (D) stype() | (IV) remove duplicate rows |
Solution
✅ Correct Option: 2
| List I | List II |
|---|---|
| (A) add() | (II) add value along a row or column |
| (B) drop_duplicates() | (IV) remove duplicate rows |
| (C) GROUP BY() | (III) group data based on column |
| (D) stype() | (I) change data type of a column |
"stype()" is the question's spelling of astype(), which converts a column to another data type, e.g. df['col'].astype(float).
In pandas the grouping method is written groupby(); "GROUP BY" with a space is the SQL clause.
Related questions:
2025: 14 May Shift 1
2026: 23 May Shift 1
2025: 21 May Shift 1
2026: 23 May Shift 1
2025: 27 May Shift 2