Open main menu

Changes

Numpy linalg

288 bytes added, 12:12, 19 June 2014
"'''...'''" Is designed to mean at this point, insert as many full slices (:) to extend the multi-dimensional slice to all dimensions.
 
<source lang"python">
print ""
a = np.arange(4).reshape(2,2)
print "a is"
print a
print "dot a"
print np.dot(a, a)
# Expand one axis in start, and tile up 2 times.
a2 = np.tile(a[None,:], (2, 1, 1))
print "a2 shape", a2.shape
a2_e = np.einsum('...ij,...jk', a2, a2)
print a2_e
</source>