Plot the Data Points
Learn how digits are formed by plotting some of the data points.
Code to plot data points
We saw earlier how we might plot a rectangular array of numbers using the imshow()
function. We want to do the same here, but we need to convert that list of comma-separated numbers into a suitable array. Here are the steps to do that:
-
Split that long text string of comma-separated values into individual values, using the commas as the place to do the splitting.
-
Ignore the first value and the label, and take the remaining list of values and turn them into an array that has a shape of rows columns.
-
Plot that array.
Again, it is easiest to show the simple Python code that does this and talk through the code to explain in more detail what is happening.
We must not forget to import the Python extension libraries first, which will help us with arrays and plotting:
Get hands-on with 1200+ tech skills courses.