title: How to detect a sign change for elements in a numpy array
body: <p>I have a numpy array with positive and negative values in.</p>
  
  <pre><code>a = array([1,1,-1,-2,-3,4,5])
  </code></pre>
  
  <p>I want to create another array which contains a value at each index where a sign change occurs (For example, if the current element is positive and the previous element is negative and vice versa). </p>
  
  <p>For the array above, I would expect to get the following result</p>
  
  <pre><code>array([0,0,1,0,0,1,0])
  </code></pre>
  
  <p>Alternatively, a list of the positions in the array where the sign changes occur or list of booleans instead of 0's and 1's is fine.</p>