I have a code like:
df = pd.DataFrame([{'a': 1, 'b': 2}])
df['c'] = min(5, df['a'] + df['b'])
my goal was to add a column 'c' to be the minimum of a constant number and the sum of column 'a' and 'b'. But Python gives error message on the second line like:
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
What does this message mean? And how can I achieve my goal?