Command
np.array([1,2,3])Explanation
Convert a Python list into a NumPy array.
Examples
1D array
np.array([1, 2, 3])2D array
np.array([[1,2],[3,4]])np.array([1,2,3])Convert a Python list into a NumPy array.
1D array
np.array([1, 2, 3])2D array
np.array([[1,2],[3,4]])