I have a pandas which is 6x3 and the columns represent times.
I want to replace values on conditions:
def substituteMin(x,n,c,k):
if x < (1 - c)^n+sqrt(k):
x = (1 - c)^n+sqrt(k)
else:
pass
return x
df1 = df.apply(lambda x: compareMin(x, x.name))
print (df1)
where c and k are constant. And n is the column name. It gives me the error
"ValueError: ('The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().', u'occurred at index 1.0')"
I tried to look at replace function but they did not work.