title: Finding Patterns in a Numpy Array
body: <p>I am trying to find patterns in a <code>numpy</code> <code>array</code>, called <code>values</code>. I'd like to return the starting index position of the pattern. I know I could iterative over each element and check whether that element and the next one match the pattern, but over a large dataset that is incredibly inefficient and am looking for a better alternative. </p>
  
  <p>I've got a working solution using <code>np.where</code> for searching for a single value, but I can't get it to work with finding a pattern or two numbers.</p>
  
  <p>Example:</p>
  
  <pre><code>import numpy as np
  values = np.array([0,1,2,1,2,4,5,6,1,2,1])
  searchval = [1,2]
  print  np.where(values == searchval)[0]
  </code></pre>
  
  <p>Output: </p>
  
  <pre><code>[]
  </code></pre>
  
  <p>Expected Output:</p>
  
  <pre><code>[1, 3, 8]
  </code></pre>