I have written a function to multiply two numpy arrays.
def ra(self): """Multiply Rotation with initial Values""" rva = self.r_array() * self.va_array() rva = np.sum(rva, axis=1) # Sum rows of Matrix rva = np.array([[rva[0]], # Transpose Matrix [rva[1]], [rva[2]]])
where:
- r_array has 3 rows and 3 columns
- va_array has 3 rows and 1 column
I feel like this should be able to be written in one line. However, self.r_array() * self.va_array()
always returns a 3 x 3 array.
Any suggestions would be greatly appreciated.
Cheers
r_array.dot(va_array)
or@
operator.\$\endgroup\$