I know this question has been asked before, however, when I am trying to do an if statement and I am getting an error. I looked at this link , but did not help
if
the comparison returns a range of values, you need to limit it either by any() or all(), for example,
if((df[col] == ' this is any string or list').any()): return(df.loc[df[col] == temp].index.values.astype(int)[0])