Saturday 15 March 2014

python - global name 'inf' is not defined -



python - global name 'inf' is not defined -

i have developed function on own in script. ran script place function in namespace. line of code have working fine is:

df.my_variable.replace([inf, -inf, nan, nan], 0, inplace=true)

i have moved function mymodule.py. seek run it:

import mymodule mm mm.myfun()

the line of code replace inf, etc., throws next error:

global name 'inf' not defined

i'm sure legacy of developing interactively in ipython, i'm stumped how define inf create work.

try this:

from numpy import inf

python pandas ipython

No comments:

Post a Comment