I faced the same mistake, I realized the syntax is missing a bracket. And also the matrix dimension need to be correct as what Nilesh Kumar and Helen answered earlier.
import numpy as np a = np.array([[8.0,7.0,6.0],[5.0,4.0, 1.0]]) print(a)