title: Finding the slices from a list of coordinates in a numpy
body: <p>I want to retrieve a list of slices from a list of coordinates in a multidimensional numpy.</p>
  
  <p>What I am doing is the following (example).</p>
  
  <p>First, I declare my base array:</p>
  
  <pre><code>base = np.zeros((8, 8, 4))
  </code></pre>
  
  <p>with a list of coordinates:</p>
  
  <pre><code>coord = [slice(0, 1, None), slice(0, None, None)]
  </code></pre>
  
  <p>Second, I create a "mask" in the numpy:</p>
  
  <pre><code>base[coord] = -1
  </code></pre>
  
  <p>Then, I extract the slices of that area:</p>
  
  <pre><code>np.argwhere(base == -1)
  </code></pre>
  
  <p>The problem I have is that I don't want to modificate the numpy in order to extract the coordinates, and of course a copy is not a possible solution. What's the way to do it or what modification I should do for obtaining the slices?</p>