I have a df with multiple columns. We need to check if any of the columns has a value 0; if 0 is there we have to add new column with tag.
I tried this :
df.loc[df['maths'] == '0', 'mark_student'] = 'fail'
This it working for single column, but when I tried it for multiple columns, it's failing
Like this :
df.loc[df['maths','chemistry'] == '0', 'mark_student'] = 'fail'
df.loc[df[['maths','chemistry']] == '0', 'mark_student'] = 'fail'