title: numpy piecewise function claiming lists are not same size
body: <p>I'm trying to write a function to pass a variable into a piecewise function, I have:</p>
  
  <pre><code>def trans(a):
      np.piecewise(a, [(a&lt;.05) &amp; (a&gt;=0),
                      (a&lt;.1) &amp; (a&gt;= .05),
                      (a&lt;.2) &amp; (a&gt;=.1),
                      (a&lt;.4) &amp; (a&gt;=.2),
                      (a&lt;1) &amp; (a&gt;=.4)],
                      [0,1,2,3,4])
  </code></pre>
  
  <p>However, when I run <code>trans(a)</code>, I get: </p>
  
  <blockquote>
    <p>ValueError: function list and condition list must be the same</p>
  </blockquote>
  
  <p>The function and condition list I used are both length 5, so I'm not sure what the issue is</p>
  
  <p>EDIT: Apparently numpy.piecewise expects an array, so I needed to pass it one, instead of a plain variable?</p>