i defined a formula and i want to have existing array data as input for this function and return results in an array .
the code
x1=np.array(x1)# <---- existing input data
x_test=[0,5,10,15] <---- just some test data
x_test=np.array(x_test)
def P_0(x):
return 295*(math.cos((0.9952*x+2.25952)*math.pi/180))**2-(295*(math.cos((0.9952*x+1.74)*math.pi/180))**2)
results=P_0(x_test)
i get error:
TypeError: Required argument 'shape' (pos 1) not found
math.functions are for scalars, though they might work with a single element array.