I am trying to do the following:
- Pass Dataframe[['ID']['Team'] to function
- If Team is Blue, return 'Y' to 'Can he play?' and also return the value 'Blue' to 'Why?'
Below is my attempt at the code.
def play(df):
if df['Team'] in list(['Blue']):
return 'Exclude','**************'
df['Can he play?'],df['Why?'] = df.apply(play, axis = 1)
I do not know how to return the dataframe value from the conditional statement
How do I return 'Blue' (the value in df['Team'])