I am trying to create a column called "Threshold" where the values are determined by calculation df['column']/30**0.5 , but I want this column to have a minimum value of 0.2. So if the calculation is below 0.2, I want the column value to be 0.2.
For example:
df['column2'] = (df['column']/30)**0.5 or 0.2 (which ever number is larger).
This is what I have currently:
df['Historical_MovingAverage_15'] = df['Historical_Average'].rolling(window=15).mean()
df['Threshold'] = max((((df['Historical_MovingAverage_15'])/30)**0.5), 0.2)
It gives me this error:
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().