jupyter nbconvert scipy_intro.ipynb --to slides --post serve

Python for Mathematics, Science and Engineering

Eine Einführung in das Scientific Computing Ökosystem



Grazer Linuxtage, 2017-04-29
claus.aichinger@gmail.com

Claus Aichinger

  • Data Scientist / Freelancer / Trainer
  • Scientific Computing with Python
    • (Statistical) Modeling
    • Data Analysis & Visualization
    • Numerical Algorithms
  • https://pydays.at/

Dieser Vortrag

  • richtet sich an (Neu)EinsteigerInnen
  • gibt einen Überblick zum Scientific Stack in Python

SciPy - Scientific Python - Python's Scientific Stack...

  • Warum verwenden?

  • Was ist das überhaupt?

  • Wie fange ich an bzw. was für Tools gibt es?

  • Zwei Beispiele:

    • Datenanalyse
    • Modellierung

Warum Scientific Computing mit Python?

Jim Hugunin, creater of Numeric (NumPy ancestor) and Jython:

(Matlab) is a wonderful language for a wide range numerical analyses; however, it is a terrible language in which to do anything else.

  • Open Source, Cross-Platform

  • Ausgereifte und umfassende Bibliotheken für viele Anwendungsfälle

  • Rapid Prototyping, Scripting

  • Tools/Konventionen die Softwareentwicklung erleichtern (pep8, pylint, pytest, tox, sphinx, ...)

  • Mögliche Alternative zu MATLAB oder R

  • Python ist eine universelle Hochsprache.

"the right tool for the job"

Warum Scientific Computing mit Python?

  • Welchen Platz nimmt Scientific Python im Python Ökosystem ein?

  • Wer verwendet Python für wissenschaftliceh Anwendungen?

Warum Scientific Computing mit Python? Stellenwert im Ökosystem:

PyPI, Python Package Index

2017-04-29 ~08:00:

The Python Package Index is a repository of software for the Python programming language. There are currently 106990 packages here.

Frage: Wieviele davon für Scientific Computing?

Hinweis:

  • Packages werde mit Hilfe von classifiers beschrieben.
  • Das Feld Topic gibt das Themengebiet an:
    • Communications
    • Internet
    • ...
    • Scientific/Engineering
Topic :: Adaptive Technologies
Topic :: Artistic Software
Topic :: Communications
Topic :: Communications :: BBS
Topic :: Communications :: Chat
Topic :: Communications :: Chat :: AOL Instant Messenger
Topic :: Communications :: Chat :: ICQ
Topic :: Communications :: Chat :: Internet Relay Chat
Topic :: Communications :: Chat :: Unix Talk
Topic :: Communications :: Conferencing
Topic :: Communications :: Email
Topic :: Communications :: Email :: Address Book
Topic :: Communications :: Email :: Email Clients (MUA)
Topic :: Communications :: Email :: Filters
Topic :: Communications :: Email :: Mailing List Servers
Topic :: Communications :: Email :: Mail Transport Agents
Topic :: Communications :: Email :: Post-Office
Topic :: Communications :: Email :: Post-Office :: IMAP
Topic :: Communications :: Email :: Post-Office :: POP3
Topic :: Communications :: Fax
Topic :: Communications :: FIDO
Topic :: Communications :: File Sharing
Topic :: Communications :: File Sharing :: Gnutella
Topic :: Communications :: File Sharing :: Napster
Topic :: Communications :: Ham Radio
Topic :: Communications :: Internet Phone
Topic :: Communications :: Telephony
Topic :: Communications :: Usenet News
Topic :: Database
Topic :: Database :: Database Engines/Servers
Topic :: Database :: Front-Ends
Topic :: Desktop Environment
Topic :: Desktop Environment :: File Managers
Topic :: Desktop Environment :: Gnome
Topic :: Desktop Environment :: GNUstep
Topic :: Desktop Environment :: K Desktop Environment (KDE)
Topic :: Desktop Environment :: K Desktop Environment (KDE) :: Themes
Topic :: Desktop Environment :: PicoGUI
Topic :: Desktop Environment :: PicoGUI :: Applications
Topic :: Desktop Environment :: PicoGUI :: Themes
Topic :: Desktop Environment :: Screen Savers
Topic :: Desktop Environment :: Window Managers
Topic :: Desktop Environment :: Window Managers :: Afterstep
Topic :: Desktop Environment :: Window Managers :: Afterstep :: Themes
Topic :: Desktop Environment :: Window Managers :: Applets
Topic :: Desktop Environment :: Window Managers :: Blackbox
Topic :: Desktop Environment :: Window Managers :: Blackbox :: Themes
Topic :: Desktop Environment :: Window Managers :: CTWM
Topic :: Desktop Environment :: Window Managers :: CTWM :: Themes
Topic :: Desktop Environment :: Window Managers :: Enlightenment
Topic :: Desktop Environment :: Window Managers :: Enlightenment :: Epplets
Topic :: Desktop Environment :: Window Managers :: Enlightenment :: Themes DR15
Topic :: Desktop Environment :: Window Managers :: Enlightenment :: Themes DR16
Topic :: Desktop Environment :: Window Managers :: Enlightenment :: Themes DR17
Topic :: Desktop Environment :: Window Managers :: Fluxbox
Topic :: Desktop Environment :: Window Managers :: Fluxbox :: Themes
Topic :: Desktop Environment :: Window Managers :: FVWM
Topic :: Desktop Environment :: Window Managers :: FVWM :: Themes
Topic :: Desktop Environment :: Window Managers :: IceWM
Topic :: Desktop Environment :: Window Managers :: IceWM :: Themes
Topic :: Desktop Environment :: Window Managers :: MetaCity
Topic :: Desktop Environment :: Window Managers :: MetaCity :: Themes
Topic :: Desktop Environment :: Window Managers :: Oroborus
Topic :: Desktop Environment :: Window Managers :: Oroborus :: Themes
Topic :: Desktop Environment :: Window Managers :: Sawfish
Topic :: Desktop Environment :: Window Managers :: Sawfish :: Themes 0.30
Topic :: Desktop Environment :: Window Managers :: Sawfish :: Themes pre-0.30
Topic :: Desktop Environment :: Window Managers :: Waimea
Topic :: Desktop Environment :: Window Managers :: Waimea :: Themes
Topic :: Desktop Environment :: Window Managers :: Window Maker
Topic :: Desktop Environment :: Window Managers :: Window Maker :: Applets
Topic :: Desktop Environment :: Window Managers :: Window Maker :: Themes
Topic :: Desktop Environment :: Window Managers :: XFCE
Topic :: Desktop Environment :: Window Managers :: XFCE :: Themes
Topic :: Documentation
Topic :: Documentation :: Sphinx
Topic :: Education
Topic :: Education :: Computer Aided Instruction (CAI)
Topic :: Education :: Testing
Topic :: Games/Entertainment
Topic :: Games/Entertainment :: Arcade
Topic :: Games/Entertainment :: Board Games
Topic :: Games/Entertainment :: First Person Shooters
Topic :: Games/Entertainment :: Fortune Cookies
Topic :: Games/Entertainment :: Multi-User Dungeons (MUD)
Topic :: Games/Entertainment :: Puzzle Games
Topic :: Games/Entertainment :: Real Time Strategy
Topic :: Games/Entertainment :: Role-Playing
Topic :: Games/Entertainment :: Side-Scrolling/Arcade Games
Topic :: Games/Entertainment :: Simulation
Topic :: Games/Entertainment :: Turn Based Strategy
Topic :: Home Automation
Topic :: Internet
Topic :: Internet :: File Transfer Protocol (FTP)
Topic :: Internet :: Finger
Topic :: Internet :: Log Analysis
Topic :: Internet :: Name Service (DNS)
Topic :: Internet :: Proxy Servers
Topic :: Internet :: WAP
Topic :: Internet :: WWW/HTTP
Topic :: Internet :: WWW/HTTP :: Browsers
Topic :: Internet :: WWW/HTTP :: Dynamic Content
Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries
Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Content Management System
Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Message Boards
Topic :: Internet :: WWW/HTTP :: Dynamic Content :: News/Diary
Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Page Counters
Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Wiki
Topic :: Internet :: WWW/HTTP :: HTTP Servers
Topic :: Internet :: WWW/HTTP :: Indexing/Search
Topic :: Internet :: WWW/HTTP :: Session
Topic :: Internet :: WWW/HTTP :: Site Management
Topic :: Internet :: WWW/HTTP :: Site Management :: Link Checking
Topic :: Internet :: WWW/HTTP :: WSGI
Topic :: Internet :: WWW/HTTP :: WSGI :: Application
Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware
Topic :: Internet :: WWW/HTTP :: WSGI :: Server
Topic :: Internet :: XMPP
Topic :: Internet :: Z39.50
Topic :: Multimedia
Topic :: Multimedia :: Graphics
Topic :: Multimedia :: Graphics :: 3D Modeling
Topic :: Multimedia :: Graphics :: 3D Rendering
Topic :: Multimedia :: Graphics :: Capture
Topic :: Multimedia :: Graphics :: Capture :: Digital Camera
Topic :: Multimedia :: Graphics :: Capture :: Scanners
Topic :: Multimedia :: Graphics :: Capture :: Screen Capture
Topic :: Multimedia :: Graphics :: Editors
Topic :: Multimedia :: Graphics :: Editors :: Raster-Based
Topic :: Multimedia :: Graphics :: Editors :: Vector-Based
Topic :: Multimedia :: Graphics :: Graphics Conversion
Topic :: Multimedia :: Graphics :: Presentation
Topic :: Multimedia :: Graphics :: Viewers
Topic :: Multimedia :: Sound/Audio
Topic :: Multimedia :: Sound/Audio :: Analysis
Topic :: Multimedia :: Sound/Audio :: Capture/Recording
Topic :: Multimedia :: Sound/Audio :: CD Audio
Topic :: Multimedia :: Sound/Audio :: CD Audio :: CD Playing
Topic :: Multimedia :: Sound/Audio :: CD Audio :: CD Ripping
Topic :: Multimedia :: Sound/Audio :: CD Audio :: CD Writing
Topic :: Multimedia :: Sound/Audio :: Conversion
Topic :: Multimedia :: Sound/Audio :: Editors
Topic :: Multimedia :: Sound/Audio :: MIDI
Topic :: Multimedia :: Sound/Audio :: Mixers
Topic :: Multimedia :: Sound/Audio :: Players
Topic :: Multimedia :: Sound/Audio :: Players :: MP3
Topic :: Multimedia :: Sound/Audio :: Sound Synthesis
Topic :: Multimedia :: Sound/Audio :: Speech
Topic :: Multimedia :: Video
Topic :: Multimedia :: Video :: Capture
Topic :: Multimedia :: Video :: Conversion
Topic :: Multimedia :: Video :: Display
Topic :: Multimedia :: Video :: Non-Linear Editor
Topic :: Office/Business
Topic :: Office/Business :: Financial
Topic :: Office/Business :: Financial :: Accounting
Topic :: Office/Business :: Financial :: Investment
Topic :: Office/Business :: Financial :: Point-Of-Sale
Topic :: Office/Business :: Financial :: Spreadsheet
Topic :: Office/Business :: Groupware
Topic :: Office/Business :: News/Diary
Topic :: Office/Business :: Office Suites
Topic :: Office/Business :: Scheduling
Topic :: Other/Nonlisted Topic
Topic :: Printing
Topic :: Religion
Topic :: Scientific/Engineering
Topic :: Scientific/Engineering :: Artificial Intelligence
Topic :: Scientific/Engineering :: Artificial Life
Topic :: Scientific/Engineering :: Astronomy
Topic :: Scientific/Engineering :: Atmospheric Science
Topic :: Scientific/Engineering :: Bio-Informatics
Topic :: Scientific/Engineering :: Chemistry
Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)
Topic :: Scientific/Engineering :: GIS
Topic :: Scientific/Engineering :: Human Machine Interfaces
Topic :: Scientific/Engineering :: Image Recognition
Topic :: Scientific/Engineering :: Information Analysis
Topic :: Scientific/Engineering :: Interface Engine/Protocol Translator
Topic :: Scientific/Engineering :: Mathematics
Topic :: Scientific/Engineering :: Medical Science Apps.
Topic :: Scientific/Engineering :: Physics
Topic :: Scientific/Engineering :: Visualization
Topic :: Security
Topic :: Security :: Cryptography
Topic :: Sociology
Topic :: Sociology :: Genealogy
Topic :: Sociology :: History
Topic :: Software Development
Topic :: Software Development :: Assemblers
Topic :: Software Development :: Bug Tracking
Topic :: Software Development :: Build Tools
Topic :: Software Development :: Code Generators
Topic :: Software Development :: Compilers
Topic :: Software Development :: Debuggers
Topic :: Software Development :: Disassemblers
Topic :: Software Development :: Documentation
Topic :: Software Development :: Embedded Systems
Topic :: Software Development :: Internationalization
Topic :: Software Development :: Interpreters
Topic :: Software Development :: Libraries
Topic :: Software Development :: Libraries :: Application Frameworks
Topic :: Software Development :: Libraries :: Java Libraries
Topic :: Software Development :: Libraries :: Perl Modules
Topic :: Software Development :: Libraries :: PHP Classes
Topic :: Software Development :: Libraries :: Pike Modules
Topic :: Software Development :: Libraries :: pygame
Topic :: Software Development :: Libraries :: Python Modules
Topic :: Software Development :: Libraries :: Ruby Modules
Topic :: Software Development :: Libraries :: Tcl Extensions
Topic :: Software Development :: Localization
Topic :: Software Development :: Object Brokering
Topic :: Software Development :: Object Brokering :: CORBA
Topic :: Software Development :: Pre-processors
Topic :: Software Development :: Quality Assurance
Topic :: Software Development :: Testing
Topic :: Software Development :: Testing :: Traffic Generation
Topic :: Software Development :: User Interfaces
Topic :: Software Development :: Version Control
Topic :: Software Development :: Version Control :: Bazaar
Topic :: Software Development :: Version Control :: CVS
Topic :: Software Development :: Version Control :: Git
Topic :: Software Development :: Version Control :: Mercurial
Topic :: Software Development :: Version Control :: RCS
Topic :: Software Development :: Version Control :: SCCS
Topic :: Software Development :: Widget Sets
Topic :: System
Topic :: System :: Archiving
Topic :: System :: Archiving :: Backup
Topic :: System :: Archiving :: Compression
Topic :: System :: Archiving :: Mirroring
Topic :: System :: Archiving :: Packaging
Topic :: System :: Benchmark
Topic :: System :: Boot
Topic :: System :: Boot :: Init
Topic :: System :: Clustering
Topic :: System :: Console Fonts
Topic :: System :: Distributed Computing
Topic :: System :: Emulators
Topic :: System :: Filesystems
Topic :: System :: Hardware
Topic :: System :: Hardware :: Hardware Drivers
Topic :: System :: Hardware :: Mainframes
Topic :: System :: Hardware :: Symmetric Multi-processing
Topic :: System :: Installation/Setup
Topic :: System :: Logging
Topic :: System :: Monitoring
Topic :: System :: Networking
Topic :: System :: Networking :: Firewalls
Topic :: System :: Networking :: Monitoring
Topic :: System :: Networking :: Monitoring :: Hardware Watchdog
Topic :: System :: Networking :: Time Synchronization
Topic :: System :: Operating System
Topic :: System :: Operating System Kernels
Topic :: System :: Operating System Kernels :: BSD
Topic :: System :: Operating System Kernels :: GNU Hurd
Topic :: System :: Operating System Kernels :: Linux
Topic :: System :: Power (UPS)
Topic :: System :: Recovery Tools
Topic :: System :: Shells
Topic :: System :: Software Distribution
Topic :: System :: Systems Administration
Topic :: System :: Systems Administration :: Authentication/Directory
Topic :: System :: Systems Administration :: Authentication/Directory :: LDAP
Topic :: System :: Systems Administration :: Authentication/Directory :: NIS
Topic :: System :: System Shells
Topic :: Terminals
Topic :: Terminals :: Serial
Topic :: Terminals :: Telnet
Topic :: Terminals :: Terminal Emulators/X Terminals
Topic :: Text Editors
Topic :: Text Editors :: Documentation
Topic :: Text Editors :: Emacs
Topic :: Text Editors :: Integrated Development Environments (IDE)
Topic :: Text Editors :: Text Processing
Topic :: Text Editors :: Word Processors
Topic :: Text Processing
Topic :: Text Processing :: Filters
Topic :: Text Processing :: Fonts
Topic :: Text Processing :: General
Topic :: Text Processing :: Indexing
Topic :: Text Processing :: Linguistic
Topic :: Text Processing :: Markup
Topic :: Text Processing :: Markup :: HTML
Topic :: Text Processing :: Markup :: LaTeX
Topic :: Text Processing :: Markup :: SGML
Topic :: Text Processing :: Markup :: VRML
Topic :: Text Processing :: Markup :: XML
Topic :: Utilities

Antwort:

  • Ca. 50000 Packages geben das Themengebiet an.
  • Davon weisen sich über 6500 Packages als Scientific/Engineering aus.
  • Damit ist das Scientific/Engineering-Label das vierthäufigste aller auf PyPI gelisteten Pakete!
topic count
Software Development 27230
Internet 11108
Utilities 8117
Scientific/Engineering 6794
System 4576
Text Processing 2395
Database 1691
Multimedia 1659
Communications 1606
Office/Business 1138
Security 1087
... ...

Warum Scientific Computing mit Python? Stellenwert im Ökosystem:

PEP 465 -- A dedicated infix operator for matrix multiplication

This PEP proposes a new binary operator to be used for matrix multiplication, called @. (Mnemonic: @ is * for mATrices.)

Hinweis: PEP = Python Enhancement Proposal

Warum Scientific Computing mit Python? Wer:

who

Was ist SciPy?

SciPy (pronounced “Sigh Pie”) is a Python-based ecosystem of open-source software for mathematics, science, and engineering.

0_NumPy

2_SciPy_matplotlib

2_pandas_SymPy_IPython

Und dann gibt es noch scikits und andere Packages...

StatsModels-logo

scikit-learn-logo

scikit-image-logo

Natural Language Toolkit

... und viele mehr!

Und wie mache ich das jetzt?

Am einfachsten mit einer Scientific Distribution:

anaconda-logo winpython-logo

Diese bieten:

  • umfangreiche Paketsammlungen (alles, was man zu Beginn braucht)
  • Paket (und Environment) Management
  • IPython (Interactive Python)
  • Spyder (IDE, vergleichbar mit Matlab oder RStudio)
  • Jupyter Notebook (Browser-basierte interaktive Entwicklungsumgebung) <-- in zwei Stunden Vortrag dazu!

run Python, Spyder with SciPy and friends out of the box

Beispiele

Gleich gibt es eine Demo...

Wo gibt's (Sci)Py?

PyGRAZ Meetup (Python User Group Graz)

PyDays Vienna

Österreichs erste (mini) Python Konferenz

  • pydays.at
  • mehr als 20 Vorträge und Workshops
  • 5.-6. Mai 2017
  • FH Technikum Wien
  • im Rahmen der Linuxwochen Wien