Let's say I have two one dimensional arrays, a and b, of length say n+1 and m+1.
I want c to be the an array of the same length as b, with elements equal to the sine of the sum of all a elements to the power b. Written in pseudo code below.
c = sum(sine(a[0:n] ** b[0])), sum(sine(a[0:n] ** b[1])),
... sum(sine(a[0:n] ** b[m])))
Is there a way I can accomplish this without using loops?
(Somewhat inexperienced in programming, hope my question makes sense.)
a function something ala this:
def function(a, b):
c = np.sum(np.sin(a ** b))
return c
aandbhave lengthn...sin(..)is the inner function. Do you want the sine of the sum or the sum of the sines?