The following is part of a on-going collection of Jupyter notebooks. The goal being to have a library of notebooks as an introduction to Mathematics and technology. These were all created by Gavin Waters. If you use these notebooks, be nice and throw up a credit somewhere on your page.
Python as a stand alone language is good, not brilliant, but good. With packages and the ability to add packages it becomes amazing.
There is nearly a package to anythin that you could want. These packages are mainly community driven, so the diversity of amazing. Lets get a random generator, python does not have a randome generator, but it sure does have a package you can import.
import random
random.random()
0.1862986211301738
You can import packages and call them something else.
import random as bob
bob.random()
0.06158089137695544
import time
time.time()
1481558370.325746
Right about now you are probably wondering what is the output that happened above.
That is one of the hidden secrets of jupyter notebooks. Let me introduce you to the tab key. Start by typing "time." then hit the tab key and you will be given all of the options available for you that is ready to be used since you imported the package time.
Its wonderful because you can explore the extend of a package that you import.
If for some strange reason you do not have a package that you want to use then you can install that package on your computer to import. One of the ways to do this is usingthe pip command.
You can either use a shell command, opening up a terminal and typing
>pip install package-name
or you can use the notebook cell by typing !pip install package-name either of thesze ways will work.
Anaconda also comes with a package manager. To use that one would open a terminal and type
>conda install package-name
Alternatively, for more advanced control you can open up the Anaconda laucher and create your own envoirnment with whatever packages you choose.