title: How do you get the indices of a Numpy slice with a step?
body: <p><strong>Original Question (with stupid example):</strong> e.g my question is simple, how do you get the index positions of a slice with step, in Numpy. See example below where you can use np.nonzero on a slice but include a step and you don't. Is there another option</p>
  
  <pre><code>import numpy as np
  d = np.hstack([np.arange(6), np.arange(6), np.arange(6)])
  step = 6
  
  np.nonzero(d[0:-1])
  Out[45]: (array([ 1,  2,  3,  4,  5,  7,  8,  9, 10, 11, 13, 14, 15, 16]),)
  
  In [46]: np.nonzero(d[0:-1:step])
  Out[46]: (array([], dtype=int64),)
  `
  </code></pre>
  
  <p><strong>Question I should have asked.</strong></p>
  
  <p>How do you get the indices of a slice with a step in Numpy.
  e.g </p>
  
  <pre><code>import numpy as np
  d = np.hstack([np.arange(6), np.arange(6), np.arange(6)])
  step = 6
  
  #The indices of d[0:-1:step] would be:
  array([ 0,  6, 12])
  </code></pre>