Data type not understood while creating a NumPy array

You are missing brackets around the two lists.

x_sample= np.array([[31000,28.69,7055.47],[79000,3.9,16933.26]])

The way it was written the dtype argument was receiving the value [79000,3.9,16933.26], which obviously cannot be interpreted as a valid NumPy data type and caused the error.

Leave a Comment