I have a numpy array A of shape(N,2) and a numpy array S of shape(N).
How do I multiply both arrays? Currently I am using this code:
tupleS = numpy.zeros( (N , 2) )
tupleS[:,0] = S
tupleS[:,1] = S
product = A * tupleS
I am a python beginner. Is there a better way to do this?
Numpy uses row-major order, so you have to explicitly create a column. As in: