[Numpy-discussion] transform an array of points efficiently?

Bruce Southey bsouthey@gmail....
Fri Jul 10 08:28:07 CDT 2009

> hey,
> great man! thanks!
> I had thought that it may have been possible with a single dot, but
> how to do it escaped me.
> Thanks again!
> Chris
When dot is not what you want, often numpy.inner() and numpy.outer() do 
what you want.
So try using numpy.inner(x,y)...

import numpy as np
x = np.random.rand(10,4)
y = np.random.rand(4,4)
print 'x\n', x, '\ny\n', y
print '\nresult\n',  np.dot(y,x.T).T
print '\ninner\n', np.inner(x,y)


More information about the NumPy-Discussion mailing list