Skip to content

Instantly share code, notes, and snippets.

@fenilgandhi
Last active August 9, 2022 14:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fenilgandhi/8c7c5107deb37e7eb3c717fdfe31018d to your computer and use it in GitHub Desktop.
Save fenilgandhi/8c7c5107deb37e7eb3c717fdfe31018d to your computer and use it in GitHub Desktop.
"""
For the given dataframe add a column `result` with specifies whether a student
has passed or failed in their term. Any student is considered pass if all their scores are equal
or above 35
"""
import numpy
import pandas
df = pandas.DataFrame([
{
"id": 1,
"english": 30,
"maths": 65,
"science": 70,
},
{
"id": 2,
"english":65,
"maths":36,
"science":28,
},
{
"id": 3,
"english":35,
"maths":35,
"science":49,
},
{
"id": 4,
"english":94,
"maths":62,
"science":95,
},
])
# Your solution here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment