Introduction au Python pour des scientifiques Module1: Initiation Sophie Cloché, Marc-Antoine Drouin, Dmitry Khvorostyanov, Estelle Lorant, Vincent Noël, Jean-Yves Peterschmitt avec des contributions précieuses de Ludmila Klenov, Yohann Morille Institut Pierre et Simon Laplace Journée de formation IPSL – 2 décembre 2014 Ecole Polytechnique, Palaiseau, France
16
Embed
Introduction au Python pour des scientifiques Module1 ...dkhvoros/ptraining/Journee-python-2014... · Introduction au Python pour des scientifiques Module1: Initiation ... 10h00 –
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Introduction au Python pour des scientifiques
Module1: Initiation
Sophie Cloché, Marc-Antoine Drouin, Dmitry Khvorostyanov,Estelle Lorant, Vincent Noël, Jean-Yves Peterschmitt
avec des contributions précieuses de
Ludmila Klenov, Yohann Morille
Institut Pierre et Simon Laplace
Journée de formation IPSL – 2 décembre 2014 Ecole Polytechnique, Palaiseau, France
Programme de la journéeMatin (maintenant) ! 9h30 : accueil café ! 10h00 – 12h45: Introduction générale à Python (amphi Becquerel) !!Midi !12h45 – 14h00 : repas (salle Aquarium) !!Après-midi 14h – 18h00: Travaux Pratiques (salles informatiques 32 et 33 de l'X)
• February 1991, the 1st published version (0.9.0): classes, exception handling, functions, core datatypes (list, dict, str...), module system
• January 1994, v1.0: functional programming paradigm tools lambda, map, filter and reduce.
• October 1996, v1.4: keyword arguments [ex.: c = jump(high = True)], complex numbers
• October, 2000, v2.0: list comprehensions (we'll see one today!), a garbage collection system (makes life easier with memory management)
• December, 2001, v2.2: new-style classes (unification of Python's types (written in C) and classes (written in Python) into one hierarchy; generators
• December, 2008, v3.0: "Reduce feature duplication by removing old ways of doing things" => no more backward compatibility!
• June, 2009, v3.1, July, 2010, v2.7. Python 2.7 was released to coincide with Python 3.1, included some features 3.1, as well as warnings for old features. The 2.7 was the last 2.x release.
Van Rossum at OSCON 2006 Photo taken from WikiPedia
Guido Van Rossum: "Benevolent Dictator For Life"
!Python creator, he oversees the
development process, making decisions
Why Python?● High-level flexible programming language
● Development speed ● Code readability ● Collaborative development, program component (re-)usability
combined with
● Rich variety of libraries for wide range of applications:
● Scientific computing − Data analysis, statistics, input/output − Data visualization − Image/signal processing, data mining, machine learning....
● Shell programming (a readable bash alternative!) ● Web / Databases ● Human-computer interaction (graphical user interfaces, virtual reality...) ● Video-games, networking, sound/text processing, linguistics, neurosciences... ● Embedded systems
● Free, open-source, permissive license (PSFL)
● Large, friendly, dynamically growing community
- AFPY: rencontres, forums, formations, documents éducatifs !! - "Planets" et "User Groups" de Python: forums, blogs, groupes thématiques... Stack Overflow: réponses à presque toutes vos questions! ! - EuroSciPy, PyCon, EuroPython, PyCon UK, OSCON, ... - échanges de compétences, tutoriaux, événements sociaux !! - Google, BitTorrent, SpamBayes, Plone CMS, MailMan, Zope, Django - Python-powered! !Des initiatives humanitaires dans des pays en développement: - Argentine Py Group: CDPedia - One Laptop Per Child: Sugar - Bungeni: système d'information pour les parlements africains + ouverts et accessibles - Python African Tour: Formations Maroc, Sénégal, Zambie, Nigéria...
Python est utilisé dans de nombreux domaines: !programmation système, réseaux, automatisation, ingénierie, serveurs
web, bases de données, images de synthèse, manipulation de texte, jeux vidéos, data mining, applications commerciales...
!... et en sciences ( Ouah ! ) !!!Python s’adapte à plusieurs types de programmation : !• Séquentielle / parallèle • Procédurale/ fonctionnele / orientée objet • Test-driven • Bête/intuitive (populaire dans les labos)
High-level and flexible language: résumé
● Available with Linux (standard distribution included), Mac OS X (standard included), Windows, Android, etc.
● Interpreters and compilers (CPython, PyPy, Cython, py2exe) ● Interfaces with other languages : Fortran (f2py), C/C++, Java (Jython, JPype,
Jepp)....
High-level and flexible language + framework
Est-ce que Python va dominer le monde? [ du travail ]
Percentage of jobs in web job listings since 2005
(from indeed.com)
% growth% job postings
Distributions Python
• python.org = python + librairies standard o numpy, etc à installer soi-meme : complexe
• distributions "intégrées" python scientifique o python + librairie standard + numpy + lecture/écriture + etc. o plus facile, à privilégier si possible o vérifier la license... (parfois payant)
•Restez pour l'après-midi •Google : Python, science,
numpy, matplotlib, tutorials...
•Bouquins (souvent en anglais,mais pas toujours)
Pour aller plus loin
TPs de cet après-midi
login machine python2... python40 !!Mot de pass: sera communiqué discrètement !Actualiser les PATHs: !$ export PATH=$HOME/../python1/anaconda/bin:$PATH !Données, énoncés, solutions (seront communiqué au fur et à mésure de votre progréssion): cp $HOME/../python1/TPx . ou x = [1, 2, 3, 4, 5]