| Name | Mark |
|---|---|
| Ben | 20 |
| James | 50 |
| Jimmy | 70 |
I have a dataframe which looks something like this. I wanna check if the name exists and then it will print the mark for that specific person.
if len(df[(df['Name'] == "James")]) != 0:
print(len(df["Mark"]))
Above is my code. Hope to get some advise!