title: problem with python function and np.vectorize
body: <p>Before I start to ask a question, I'm sorry not to be skilled in expressing my question in english and doing python...</p>
  <p>To practice np.vectorize, I was writing some code.</p>
  <pre><code>def H(x):
  if x == 0 : 
      return 0.5
  elif x &gt; 0:
      return 1
  else :
      return 0
  </code></pre>
  <p>then, I define vH as vectorized function.</p>
  <pre><code>vH = np.vectorize(H)
  </code></pre>
  <p>and it works as I expect.</p>
  <pre><code>vH(0)
  array(0.5)
  </code></pre>
  <p>however, when a input array has a negative number, it doesn't work for &quot;zero&quot;.</p>
  <pre><code>a = np.array([ -1,  0. , 0, 1 ])
  vH(a)
  array([0, 0, 0, 1])              # I expect the result array([0, 0.5, 0.5, 1])
  </code></pre>
  <p>I try to find the reason and solution about this problem.
  I really don't know why it happen...
  Do I miss something???</p>
  <p>please answer why it happen and how to fix it</p>
  <p>thank you for reading this question!</p>