Vous êtes sur la page 1sur 1

Project in Modelling of Living Systems: Python Quick Guide

Modélisation des systèmes biologiques — Travaux pratiques


Instructor
Arezki Boudaoud, arezki.boudaoud@polytechnique.edu
Dynamique des populations et infectiologie
Suggested tools
Suggested tools are Python and Jupyter, though you may use other programming languages if
0you are more familiar with them.
Documentation It is also suggested to use a platform allowing to keep track
Python
of software versions, e.g. github or gitlab.
—1) Introduction à Python
install Anaconda, :
https://www.anaconda.com/download/ , on your own computers;
https://www-gtr.iutv.univ-paris13.fr/Cours/Mat/Python/python_tutoriel_
2) go through a Jupyter tutorial, e.g https://www.dataquest.io/blog/jupyter-notebook-
fr.pdf
tutorial/;
—3) if youenare
Aide ligne
not :familiar
https://docs.python.org/2/library/
with Python, please try the instructions given in Appendix, and
— Aide
read du logicielB,: McAnany
Ekmekci fonction help().
CE, Mura C (2016) An Introduction to Programming for
Bioscientists: A Python-Based Primer. PLoS Comput Biol 12(6): e1004867.
https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1004867, and try
1 Démarrer
a few examples.avec Python (version 2.7)
4) follow https://lab.github.com/githubtraining/introduction-to-github and install
Pour les étudiants rédigeant un rapport : ne faites pas de rapport sur cette section ; décrivez
https://lab.github.com/githubtraining/introduction-to-github
en deux phrases votre niveau en informatique et plus particulièrement en Python.
On peut taper les instructions dans la fenêtre de commande, accessible depuis le menu
"Applications".
Appendix Selon votre connaissance de Python, essayez les instructions suivantes :

— A=[1, 1, 1, 2, 4, 8, 3, 9, 27] B.dot(B)


A[0] B.dot(B[0:3,:])
A[2:5] B.shape
A[-1] B[0:3,:].shape
import numpy as np np.transpose(B)
np.mean(A) np.transpose(B).shape
np.std(A) — A=np.ones([2,3])
len(A) A=np.zeros([2,3])
len(A[2:5])) A=np.eye(2)
np.append(A,12) from numpy.random import rand
— A=range(10) A=rand(2,2)
A=np.arange(0,1,0.1) — np.linalg.eig([[1,0],[0,1]])
— A=[[1, 1, 1,], [2, 4, 8], [3, np.linalg.eig([[0,1],[1,0]])
9, 27], [3, 8.1, 3]] — import pylab
A x=np.arange(0,10,0.01)
A[2,2] y=np.exp(-x)*np.cos(x)
A[2][2] pylab.plot(x,y,"b")
A*A pylab.xlabel("x")
B = np.array(A) pylab.ylabel("y")
B[2,2] pylab.title("y=exp(-x)*cos(x)")
B*B pylab.show()

Par la suite, il sera plus pratique d’écrire des scripts "script.py" dans l’éditeur de
Python (version 2.7), qui est accessible du menu "Files>New". Python permet d’exécuter
les scripts à partir du menu "Run>Run Module".

Vous aimerez peut-être aussi