Practice Select Data
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Easy#2880
LeetCode ProblemSelect Data
Problem Statement
The students DataFrame has student_id (int), name (object) and age (int) columns. Select the row with student_id equal to 101 and return only its name and age columns.
Source: Select Data on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
Input
+------------+---------+-----+ | student_id | name | age | +------------+---------+-----+ | 101 | Ulysses | 13 | | 53 | William | 10 | | 128 | Henry | 6 | | 3 | Henry | 11 | +------------+---------+-----+
Output
+---------+-----+ | name | age | +---------+-----+ | Ulysses | 13 | +---------+-----+
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.