You can import numpy in Python3 by using the following command:
import numpy as np
This imports the numpy module and binds it to the name np
. This is a common convention used by most programmers when working with numpy.
Once you have imported numpy, you can use its functions and objects by using the np
namespace. For example, to create a numpy array, you can write:
my_array = np.array([1, 2, 3])
Here, np.array()
is used to create a new numpy array.