title: How to express assignment to indexed arrays less verbose?
body: <p>I am coming from python and there I can do the following with <code>numpy.ndarray</code></p>
  <pre class="lang-py prettyprint-override"><code>import numpy as np
  
  res = np.zeros(4, dtype=np.float32)
  x = np.array([2, 3, 4, 5])
  res[0:2] = -x[2:4]
  print(res)
  &gt;&gt;&gt; [-4 -5 0 0]
  </code></pre>
  <p>I tried to do the same thing with the <code>ndarray</code> crate but it is very verbose. Especially due to the unary minus which I could not directly apply to the sliced array, but had to apply it to whole <code>x</code> and then take a slice from it.</p>
  <pre class="lang-rust prettyprint-override"><code>use ndarray::prelude::*;
  
  let mut res = Array1::&lt;f32&gt;::zeros(4);
  let x = array![2f32, 3., 4., 5.];
  res.slice_mut(s![0..2]).assign(&amp;(-x).slice(s![2..4]));
  println!(&quot;{}&quot;, res);
  &gt;&gt;&gt; [-4, -5, 0, 0]
  </code></pre>
  <p>Plus, it looks kinda nasty compared to just doing it for each index separately in case of a small array.</p>
  <pre class="lang-rust prettyprint-override"><code>use ndarray::prelude::*;
  
  let mut res = Array1::&lt;f32&gt;::zeros(4);
  let x = array![2f32, 3., 4., 5.];
  res[[0]] = -x[2];
  res[[1]] = -x[3];
  println!(&quot;{}&quot;, res);
  &gt;&gt;&gt; [-4, -5, 0, 0]
  </code></pre>
  <p>So can I do this better? Is there a more idiomatic way that looks something like the second approach for rust but is scalable for big arrays? I am asking this, because I think my first approach makes understanding the code really hard. I still have a bug in my actual code, where the first approach doesn't work. I think I simply made a mistake, because the toy example here works. But that's kind of my point. It is hard to read and easy to make mistakes with the verbose syntax.</p>
  <p>I am using cargo 1.55.0 and ndarray=&quot;0.15.3&quot;.</p>