P
Peter Rowat
This must be a trivial question:
I have "import numpy as np" in the python startup file.
A file called mod1.py contains "def myfn..."
and inside myfn there is a call to, say, "np.convolve".
Interactively:
Error: global name "np" is not known.
=======
Why is "np" not known to functions in an imported module ?
=======
I can fix this by including "import numpy as np" in any module that uses numpy
functions -- but then what is the point of having a startup file?
-- PeterR
I have "import numpy as np" in the python startup file.
A file called mod1.py contains "def myfn..."
and inside myfn there is a call to, say, "np.convolve".
Interactively:
..... (numpy imported as np)python
import mod1
mod1.myfn(...)
Error: global name "np" is not known.
=======
Why is "np" not known to functions in an imported module ?
=======
I can fix this by including "import numpy as np" in any module that uses numpy
functions -- but then what is the point of having a startup file?
-- PeterR