es ======
Aide mémoire synthétique sur le langage Python.
===== Règles de base =====
Ces règles peuvent être testées via le mode interactif de Python (en utilisant la fenêtre "Shell" ou console de l'... re de gauche à droite
==== Scripts ou programmes Python, où les conserver, et comment les nommer : ====
i... e calcul, utilisation graphique, interface,...).
Python propose des lignes directrices sur le style d'écr
thèque très puissante du langage de programmation Python destinée à tracer et visualiser des données sous ... Elle est souvent combinée avec les bibliothèques python de calcul scientifique :
* [[http://www.numpy.o... ttps://towardsdatascience.com/5-quick-facts-about-python-matplotlib-53f23eab6d31]]
===== Installation ===... ibution/|Anaconda]] ou [[http://code.google.com/p/pythonxy/|Python (x, y)]]
* Sous GNU/Linux, on peut au
chtofreedom/7-levels-of-using-the-zip-function-in-python-a4bd22ee8bcd|7 Levels of Using the Zip Function in Python]]
* itertools.cycle() est une méthode utile pou... rmatique/cours/pratiques-avancees-et-meconnues-en-python/les-generateurs-2]]
* [[http://feldboris.alwaysdata.net/blog/python-les-iterateurs-et-les-generateurs-fr.html]]
* [
n]]
* [[https://www.datacamp.com/community/blog/python-pandas-cheat-sheet|Pandas Cheat Sheet for Data Science in Python]]
===== Applications, exemples =====
==== Préam... r sur la documentation officielle)
* ...
<code python jse-dataset-body-dimensions-read-10.py>
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar
e les contributions à cpython, le cœur du langage Python : [[https://lukasz.langa.pl/f15a8851-af26-4e94-a4... es de base,...) =====
* {{:teaching:progappchim:python-overview-3.pdf|Présentation et principes de base de la programmation en Python, avec quelques applications}} + [[codes_presentat... ation et principes de base de la programmation en Python, avec quelques applications]]** (version wiki)
mPy est une extension du langage de programmation Python, destinée à manipuler des matrices ou tableaux mu... mériques =====
On convertit facilement des listes Python en tableau numpy. Essayez ceci :
<code python>
import numpy as np
a = np.array([[1,2],[3,4]])
print(a)
pr... ist|cette ancienne documentation]].
</note>
<code python arrays_01.py>
#! /usr/bin/env python
# -*- coding
ils analytiques et de visualisation. La librairie python Plotly permet de créer des graphes dans l'environ... ter
===== Références =====
* [[https://plot.ly/python/|plot.ly]], le site officiel
* [[wp>Plotly]]
* [[https://plot.ly/python/|Plotly Python Open Source Graphing Library]]
* [[https://plot.ly/python/ipython-notebook-tutorial/|Jup
====== Programmation Python Orientée Objet ======
FIXME : en construction
===== Concepts utilisés =====
... : c'est... n'importe quoi, qui peut être codé. En Python, tout est objet !
* Une classe est une descript... e : ...
* Abstraction
* Polymorphisme
<code python intro-OO-01.py3>
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Introduction to object-oriented prog
eyhunner.com/2016/02/how-to-merge-dictionaries-in-python/|Fusionner deux dictionnaires]]
* [[https://towardsdatascience.com/30-python-best-practices-tips-and-tricks-caefb9f8c5f5|0 Python Best Practices, Tips, And Tricks - Improve your Python knowledge and skills]] Erik van Baaren, Medium, Ja
ter)]], 19/02/2020, Washington Post
* [[https://pythonprogramming.altervista.org/getting-data-about-coronavirus-with-python-in-italy/?doing_wp_cron=1582794641.9605190753936767578125|Getting data about Coronavirus with Python in Italy]] Posted by pythonprogramming on 26/02/2020
* [[https://github.com/pdtyreus/coronavirus-ds|Cor
rmat jpg dans le même répertoire que le programme python
<code python image_import-02.py>
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
show jpg image
image jpg : https://... st/index.html
"""
from PIL import Image
# install python3 module pillow using e.g. conda install
# Load t
thon]] est une librairie de programmes en langage Python dédiée à l'étude de séquences (ADN, ARN, protéine... r les nucléotides d'une séquence ADN =====
<code python Counting_DNA_Nucleotides-01.py>
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
On dispose d'un exemple... rouver un motif =====
+ lecture de fichier
<code python Finding_a_Protein_Motif-01.py>
#!/usr/bin/env pyt