I don't really understand the operation you have in mind that should lead to
your desired result, so here's a way to get it that discards most of mat's
content: (which does not seem needed to compute what you want):
(stack.T * mat[0, 0]).T
-=- Olivier
2011/10/11 Martin Raspaud
> -BEGIN PGP
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 11/10/11 07:49, Martin Raspaud wrote:
> Hi all,
[...]
> I'm looking for the operation needed to get the two (stacked) vectors
> array([[0, 1, 2],
>[6, 8, 10]]))
> or its transpose.
Hi again,
Here is a solution I just found:
np.einsum("ik,
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi all,
I have a stack of vectors:
v1 = np.arange(3)
v2 = np.arange(3) + 3
stack = np.vstack(v1, v2)
(now stack is :
array([[0, 1, 2],
[3, 4, 5]]))
and a 3d matrix:
mat = np.dstack((np.eye(3), np.eye(3) * 2))
(mat is now
array([[[ 1., 2.],