This course can be used for two learning cases:
The mastery of these tools allows the scientist to work on his data and present them in a few very expressive lines of code.
Python offers many scientific libraries that enrich it and allow it to be one of the best toolbox for the scientist. Here are the main libraries of this course:
Libraries rely on those beneath them. We have from bottom to top:
The colors correspond to the type of the library:
In this course we use the following versions of the libraries:
Libraries rely on those beneath them. We have from bottom to top:
Python the language with already very useful structures and algorithms Numpy adds the notion of high performance table and algorithms to work on these tables__Matplotlib__is the historical library to draw curves__Plotly__is a rising library to plot dynamic curves __Scipy__an algorithm set that enriches Numpy and offers a large amount of tools needed by scientists__Pandas__the super spreadsheet that handles very large complex tables *__Seaborn__an extension of Matplotlib adding a nicer rendering and statistical graphs
The colors correspond to the type of the library:
brown: new data structure yellow: set of algorithms
In this course we use the following versions of the libraries:
from IPython.display import Markdown
import numpy, scipy, matplotlib, pandas, seaborn, plotly
import sys
echo = f"""
* Python {sys.version}
* Numpy {numpy.__version__}
* Scipy {scipy.__version__}
* Pandas {pandas.__version__}
* Matplotlib {matplotlib.__version__}
* Seaborn {seaborn.__version__}
* Plotly {plotly.__version__}
"""
Markdown(echo)
Other libraries will be used for local needs (datetime, tarfile, imageio ...)
Libraries rely on those beneath them. We have from bottom to top:
Python the language with already very useful structures and algorithms Numpy adds the notion of high performance table and algorithms to work on these tables__Matplotlib__is the historical library to draw curves__Plotly__is a rising library to plot dynamic curves __Scipy__an algorithm set that enriches Numpy and offers a large amount of tools needed by scientists__Pandas__the super spreadsheet that handles very large complex tables *__Seaborn__an extension of Matplotlib adding a nicer rendering and statistical graphs
The colors correspond to the type of the library:
brown: new data structure yellow: set of algorithms *blue: graphic library
In this course we use the following versions of the libraries:* Python 3.6.5
Numpy 1.14.5 Scipy 1.0.1
Matplotlib 2.2.2 Pandas 0.23.3 (with the latest version of Pandas DataReader pip install git + https://github.com/pydata/ pandas-datareader
)
*Seaborn 0.8.1
If Python is greatly enriched by its libraries, it also has tools that make it easier to use. The best known is Jupyter which allows to work in a browser which offers the possibility to mix text, code and images. This is the tool used by this course and besides. You are now looking at a Jupyter Notebook (with one hidden code cell).
A Jupyter Notebook is made up of cells that you can guess if you click on the text. There are different cell types that are chosen with the drop-down menu in the middle of the icons at the top of the page:
You can add
a cell with the +
symbol at the top of the page, delete a cell with the scissors, move a cell with the arrows and edit it by double clicking on it. We will see that the cells are executed to obtain the result of the written code. All this is found in the menu
Cell
.
Jupyter takes its name from 3 languages namely Julia, Python and R. Today the list of languages that we can
use in a Jupyter is much longer but in any case you need a kernel that makes the interface
between Jupyter and language. In the case of Python the kernel is iPython. It is chosen at the creation of the sheet
and you can interact with it using the Kernel
menu.
The other menus are more traditional and do not require explanation (forget about Widget
).
You can install Python, Jupyter, iPython and all the above libraries on your computer with your package manager and pip or Anaconda.
You can also use the services of Kaggle Kernel or Google Colab. Both create Jupyter notebooks and execute them.
{{ PreviousNext('/','Jupyter.ipynb') }}
Note : le △ ci-dessus renvoie à la table de matières.