How to Solve NameError: name 'rand' is not defined -- numpy

Solution: Import the 'rand' module

To Solve the error, add the following line to the top of your code.

from numpy.random import rand

 

For more information:
Python numpy rand