It uses jupyter ipython notebook.
In this first ipython class let's see
Teacher: Mickael
Tester: Christian
website: hu datascience
In [1]:
# == Basic import == #
# plot within the notebook
%matplotlib inline
# No annoying warnings
import warnings
warnings.filterwarnings('ignore')
Create two random variables, "x" and "y". Each must be an array of 100 points between 0 and 1 from an uniform distribution.
Starts by importing numpy and then, use the random class numpy has. (more information about numpy.random here)
In [ ]:
Print the variable to check the numbers looks correct.
In [ ]:
Start by importing the pyplot library of matplotlib.pyplot (matplotlib.pyplot).
All you need to know about matplotlib is here. Make use of this website that have most of what you need to ba able to use this plotting library (check this for instance).
In the figures make:
In [ ]:
In [ ]:
Most likely you do not see things really well...
So first, force thenm to share the same range (say between -0.2 and 1.2), with 7 bins. Then, change the style (type) of the histogram to step. (use the shift-tab -you can do it twice in a row- trip to see function options). The x and y must still be yellow and blue and we should still see the legend.
Alsom make the "sun" line thicker (say 2) and more transparent (say to 0.5).
Tip check the lw (linewidth), ec (edgecolor), alpha, etc. options
In [ ]:
In [ ]:
In [ ]: