cannot reshape array of size 64 into shape (28,28)
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Not able to reshape the image in mnist dataset using sklean This is the starting portion of my code just load the data some_digit = X[880] some_digit_image = some_digit.reshape(28, 28) ERROR PART ValueError Traceback (most recent call last) <ipython-input-15-4d618bdb57bc> in <module> 1 some_digit = X[880] ----> 2 some_digit_image = some_digit.reshape(28,28) ValueError: cannot reshape array of size 64 into shape (28,28) 回答1: You can only reshape it into a 8, 8 array. 8x8=64 回答2: try: some_digit = X[880] some_digit_image = some_digit.reshape(8