Using the example dataframe below,
How do I iterate over both Grade 1 and Grade 2 columns to select any grade 1 greater than 24 with any Grade 2 greater than 50 using list_comprehension or vectorization mentioned here
import pandas as pd
data = {'Name':['Jai', 'Princi', 'Gaurav', 'Anuj'],
'Grade 1':[27, 24, 22, 32],
'Grade 2':[60, 50, 75, 60],
'Final Grade':[77, 74, 97, 92]}
df = pd.DataFrame(data)
print(df[['Name', 'Grade 1', 'Grade 2','Final Grade']])
Based on those conditions I would like the expected output to return something like:
Jai has Grade 1 score of 27 and Grade 2 score of 60
Anuj has Grade 1 score of 32 and Grade 2 score 60
Gaurav has Grade 1 score of 22 and Grade 2 score of 75
Following a tutorial but trying to go beyond in understanding how to implement either of those concepts.