For a series containing strings and NaN values, why does series.apply(not_happy)
where not_happy is defined by:
def not_happy(element):
if 'subtring' in element:
return True
else:
return False
gives the error "TypeError: argument of type 'float' is not iterable"
One of the values in the series you're applying the funciton on in not of str type or probably you have some missing values.