Last active
August 9, 2022 14:15
-
-
Save fenilgandhi/8c7c5107deb37e7eb3c717fdfe31018d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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