0

I have this code, and it's supposed to plot me a chart with a number, but it won't work. And I don't get any error

import numpy
import matplotlib.pyplot

# %matplotlib inline
all_values = data_list[0].split(',')
image_array = numpy.asfarray(all_values[1:]).reshape((28, 28))
matplotlib.pyplot.imshow(image_array, cmap='Greys', interpolation='None')
plt.show(image_array, cmap='Greys', interpolation='None')  
scaled_input = (numpy.asfarray(all_values[1:]) / 255.0 * 0.99) + 0.1
print (scaled_input)

Thank you for your answers!

1
  • This is not a minimal reproducible example so we can't really help much. If this is the exact code you are running, then you are not even running it because this code produces many errors so I don't think it is fair to blame Pycharm Commented May 29, 2020 at 19:56

1 Answer 1

1

Your code should not even run:

  • all_values = data_list[0].split(',') should give NameError: data_list undefined
  • plt.show should give NameError: plt undefined
  • plt.show(image_array, cmap='Greys', interpolation='None') should give TypeError: got an unexpected keyword argument 'cmap'

My guess is that your code did not run at all... In PyCharm, you should be able to right click on your script and click on run script or something

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.