value error for simple definition to generate list of colors
问题 I am making a simple definition to return a list of colors based on some intervals. Unfortunately I keep getting the following error: ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all(). I have seen the following discussion on stackoverflow but only had failed attempts to make it work. Truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all() This is my code: y = 5 std = pd.Series([1,1,1,1]) values = pd