Im trying to lambdify this function
def f(x):
if ceil(x)%2 == 0:
return -1
else :
return +1
a = sympy.lambdify(x,f(x))
Im getting an error when i try to do that. I also tried piecewise , but it is not giving me the desired outcome
y = lambdify(x,(Piecewise((1, ceil(x)%2 == 0), (-1,True))))
Please help Thanks in advance