Python data science handbook: Dateframe has no attribute reshape

  machine-learning, python

After using X.test.values.reshape, I still cannot get images

ig, axes = plt.subplots(10, 10, figsize=(8, 8), subplot_kw={'xticks':[], 'yticks':[]}, 
gridspec_kw=dict(hspace=0.1, wspace=0.1))
test_images = Xtest.reshape(-1,8,8) 
for i, ax in enumerate(axes.flat):
    ax.imshow(test_images[i], cmap='binary', interpolation='nearest')
    ax.text(0.05, 0.05, str(y_model[i]), transform=ax.transAxes, color='green' if (ytest[i] == 
y_model[i]) else 'red')

Source: Python Questions

LEAVE A COMMENT