I created a module which is going to be used in several python scripts. The structure is as follows:
Main file:
import numpy as np
from mymodule import newfunction
f = np.arange(100,200,1)
a = np.zeros(np.shape(f))
c = newfunction(f)
mymodule.py:
def newfunction(f):
import numpy as np
b = np.zeros(np.shape(f))
return b
if __name__ == "__main__":
import numpy as np
Don't mind the functionality of this program, but the problem is that when I run it, I get "NameError: global name 'zeros' is not defined".
What am I missing out on here?