In Pandas, I am trying to apply this lambda function, using .apply() and I am getting this error: 'ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()'.
What am I doing wrong?
(beers[:10] - beers.mean()).apply(lambda x: 'low' if x < 0 else 'high')
beers is a series.
Thanks!