Python graphics in Jupyter
How does Python graphics work in Jupyter?
I started another view for this named Python Graphics
so as to distinguish the work from the previous work.
If we were to build a sample dataset of baby names and the number of births in a year of that name, we could then plot the data.
The Python coding is simple:
import pandas import matplotlib %matplotlib inline baby_name = ['Alice','Charles','Diane','Edward'] number_births = [96, 155, 66, 272] dataset = list(zip(baby_name,number_births)) df = pandas.DataFrame(data = dataset, columns=['Name', 'Number']) df['Number'].plot()
The steps of the script are as follows:
- Import the graphics library (and data library) that we need.
- Define our data.
- Convert the data into a format that allows easy graphical display.
- Plot the data.
We would expect a graph of the number of births by baby name.
If we take the preceding script and place it into cells of our Jupyter ...