title: global name 'inf' is not defined
body: <p>I have developed a function that was on its own in a script. I ran that script to place the function in my namespace. The line of code I have that was working fine is:</p>
  
  <pre><code>df.my_variable.replace([inf, -inf, nan, NaN], 0, inplace=True)
  </code></pre>
  
  <p>I have now moved this function into <code>mymodule.py</code>. I then try to run it:</p>
  
  <pre><code>import mymodule as mm
  mm.myfun()
  </code></pre>
  
  <p>The line of code to replace <code>inf</code>, etc., now throws the following error:</p>
  
  <pre><code>global name 'inf' is not defined
  </code></pre>
  
  <p>I'm sure this is a legacy of developing interactively in IPython, but I'm stumped as to how I would define <code>inf</code> to make this work.</p>