I've tried searching with Google and in stackoverflow, but I can't find the answer to this simple question, that has probably been asked many times before
In file f1.py, I have
import numpy as np
In file f2.py, I have
import f1
class One:
mat = np.array([[1]]))
When I run f2, I get the error message that 'np' is undefined. How should I express my obvious intentions? To give background, I am writing my first python3 program that is not a toy program. f1 represents the substantial code. f2 is supposed to be a unittest program. However, some fundamental misunderstanding of python syntax is preventing me from making progress. I thought that the import of f1 would bring np into the namespace of f2, but it doesn't seem to.