title: Item assignment for flattened array
body: <p>I am translating a FEM-DG solver, and to apply boundary conditions, I must apply the following code:</p>
  <p><code>dEz.T.flatten()[mapB] = 2*Ez.T.flatten()[vmapB]</code></p>
  <p>where both <code>dEz</code> and <code>Ez</code> are of type <code>&lt;class 'numpy.ndarray'&gt;</code>. However, after, I check with the assignment with the assertion,
  <code>assert np.all(dEz.T.flatten()[mapB] == 2*Ez.T.flatten()[vmapB])</code></p>
  <p>which ultimatly fails.</p>
  <p>I admit, the flattening and the transpose seems long-winded, but I am translating code from Matlab where the assignment is a little more straightforward, but perhaps I am missing something.</p>
  <p>Here is a small example, which shows my problem:</p>
  <p>``</p>
  <pre><code>import numpy as np;
  E = np.linspace(1, 20, 20).reshape((4, 5));
  V = E + 5;
  E.T.flatten()[[0, 1, 2]] = V.T.flatten()[[7, 10, 1]];
  assert np.all(E.T.flatten()[[0, 1, 2]] == V.T.flatten()[[7, 10, 1]])
  </code></pre>
  <p>``</p>
  <p>Thank you in advance for helping me resolve this issue.</p>