I am receiving a TypeError that I can’t resolve. Here is my error message:
TypeError Traceback (most recent call last)
in
----> 1 X = center_data(imgs_flatten)
2 plt.imshow(X[0].reshape(64,64), cmap=‘gray’)
in center_data(Y)
10 ### START CODE HERE ###
11 mean_vector = Y.mean(axis=0, dtype=np.float64)
—> 12 mean_matrix = Y.repeat(mean_vector, Y.shape[0])
13 # use np.reshape to reshape into a matrix with the same size as Y. Remember to use order=‘F’
14 mean_matrix = Y.reshape(mean_matrix, Y.shape, order=‘F’)
TypeError: Cannot cast array data from dtype(‘float64’) to dtype(‘int64’) according to the rule ‘safe’
I would appreciate any help. Thank you.