________ is the command to display the last 2 rows of a DataFrame.
________ is the command to display the last 2 rows of a DataFrame.
Solution
✅ Correct Option: 1
DataFrame.tail(n) returns the last rows of a DataFrame, so tail(2) gives the last 2 rows, and print() displays them.
Option 2: a negative value in tail(-2) returns all rows except the first 2, not the last 2.
Option 3: head(-2) returns all rows except the last 2.
Option 4: tail() with no argument returns the last 5 rows by default.
Related questions:
2026: 21 May Shift 1
2026: 23 May Shift 1
2025: 13 May Shift 2
2025: 15 May Shift 2