I need to compare two columns with specific values to get a sum at the end of all the records that match.
For example: in the 'Survived' column the value for each record must be 1 and for the 'Pclass' column the value of the record can be 1 or 2
I tried the following code but Python throw a ValueError
df['Match'] = np.where((df['Survived'] == 1) and (df['Pclass'] == 1 or 2))
With this im expecting get the calculation of how many people survived and their class was 1 or 2