Answers for "grid_data=d.iloc[index].as_matrix( ).reshape(28,28) not working"

0

grid_data=d.iloc[index].as_matrix( ).reshape(28,28) not working

# display or plot a number.
plt.figure(figsize=(7,7))
idx = 100

grid_data = d.iloc[idx].as_matrix().reshape(28,28) # reshape from 1d to 2d pixel array
plt.imshow(grid_data, interpolation = "none", cmap = "gray")
plt.show()

print(l[idx])
Posted by: Guest on July-15-2021

Code answers related to "grid_data=d.iloc[index].as_matrix( ).reshape(28,28) not working"

Browse Popular Code Answers by Language