y = numpy.zeros(shape=(1, 2)) print(y[0][0]) <class 'numpy.float64'> y[0][0] = '12' print(y[0][0]) y[0][0] = 'handlesdf' print(y[0][0]) #Error
When declaring y = numpy.zeros(shape=(1, 2)), the element type in y is float64 by default, and then the string is automatically converted to float64