Problem 2: Filter Students Who Passed
Easypython
Learn the Concept: PandasProblem Description
Write a Python program that creates a DataFrame of students with their marks, then filters and prints only the students who scored 40 or above.
Input
A DataFrame with "name" and "marks" columns.
Output
A filtered DataFrame containing only the passing students.
Constraints
- Marks range from 0 to 100.
Example Input
text{"name": ["Aarav", "Meera", "Kabir"], "marks": [30, 92, 45]}
Example Output
textname marks 1 Meera 92 2 Kabir 45
Concepts Covered
DataFrame filtering with conditions.
Related Problems
- Problem 1: Create and Explore a DataFrameEasy · pythonSolve Problem
- Problem 3: Add a Grade ColumnEasy · pythonSolve Problem
- Problem 4: Row Selection with loc and ilocEasy · pythonSolve Problem