title: Why can't I raise to a negative power in numpy?
body: <p>I'm modelling the Riemann theta function:</p>
  
  <pre><code>import numpy as np
  def theta(s, n=100):
      a_range = np.arange(2, n + 1)
      return 1 + sum(1/(a_range ** s))
  </code></pre>
  
  <p>It does not work for negative <code>s</code>; e.g. <code>theta(-2)</code> leads to this error:</p>
  
  <pre><code>      1 def theta(s, n=100):
        2     a_range = np.arange(1)
  ----&gt; 3     return 1 + sum(1/(a_range ** s))
        4 
        5 theta(-2)
  
        ValueError: Integers to negative integer powers are not allowed.
  </code></pre>
  
  <p>Why's that? <code>x^-1</code> should just be <code>1/x</code> if i recall my math correctly.</p>