I am trying to create a 2 * 3 numpy array as below:
x_sample= np.array([31000,28.69,7055.47],[79000,3.9,16933.26]);
But I get:
TypeError: data type not understood
Why am I getting the error?
The TypeError: data type not understood also occurs when trying to create a structured array, if the names defined in the dtype argument are not of type str.
Consider this minimal example:
numpy.array([], dtype=[(name, int)])
type(name) is unicodetype(name) is bytestype(name) is str(tested with Python 2.7 + numpy 1.14, and Python 3.6 + numpy 1.15)