Error NameError: name ‘np’ is not defined

As @aydow says, “change from numpy import * to import numpy as np“: Or don’t write np: Because, from numpy import *, Import every function in numpy, so np is not a function of numpy, so have to Import numpy like import numpy as np, Or, Remove np part of np.random.randint(low=10, high=30, size=6), and make it like this: random.randint(low=10, high=30, size=6), it’s all since random is a function of … Read more