mirror of
https://github.com/kennethreitz/python-guide.git
synced 2026-06-05 23:00:18 +00:00
Rewording and wrapping in scenarios/scientific.
This commit is contained in:
@@ -5,12 +5,12 @@ Scientific Applications
|
|||||||
Context
|
Context
|
||||||
:::::::
|
:::::::
|
||||||
|
|
||||||
Python is frequently used for high-performance scientific applications. Python
|
Python is frequently used for high-performance scientific applications. It
|
||||||
is widely used in academia and scientific projects because it is easy to write,
|
is widely used in academia and scientific projects because it is easy to write
|
||||||
and it performs really well.
|
and performs well.
|
||||||
|
|
||||||
Due to its high performance nature, scientific computing in Python often refers
|
Due to its high performance nature, scientific computing in Python often
|
||||||
to external libraries, typically written in faster languages (like C, or
|
utilizes external libraries, typically written in faster languages (like C, or
|
||||||
FORTRAN for matrix operations). The main libraries used are `NumPy`_, `SciPy`_
|
FORTRAN for matrix operations). The main libraries used are `NumPy`_, `SciPy`_
|
||||||
and `Matplotlib`_. Going into detail about these libraries is beyond the scope
|
and `Matplotlib`_. Going into detail about these libraries is beyond the scope
|
||||||
of the Python guide. However, a comprehensive introduction to the scientific
|
of the Python guide. However, a comprehensive introduction to the scientific
|
||||||
@@ -24,13 +24,14 @@ Tools
|
|||||||
IPython
|
IPython
|
||||||
-------
|
-------
|
||||||
|
|
||||||
`IPython <http://ipython.org/>`_ is an enhanced version of Python interpreter.
|
`IPython <http://ipython.org/>`_ is an enhanced version of Python interpreter,
|
||||||
The features it provides are of great interest for the scientists. The `inline mode`
|
which provides features of great interest to scientists. The `inline mode`
|
||||||
allow graphics and plots to be displayed in the terminal (Qt based version).
|
allow graphics and plots to be displayed in the terminal (Qt based version).
|
||||||
Moreover the `notebook` mode supports literate programming and reproducible science
|
Moreover, the `notebook` mode supports literate programming and reproducible
|
||||||
generating a web-based Python notebook. This notebook allowing to store chunk of
|
science generating a web-based Python notebook. This notebook allows you to
|
||||||
Python code along side to the results and additional comments (HTML, LaTeX, Markdown).
|
store chunks of Python code along side the results and additional comments
|
||||||
The notebook could be shared and exported in various file formats.
|
(HTML, LaTeX, Markdown). The notebook can then be shared and exported in various
|
||||||
|
file formats.
|
||||||
|
|
||||||
|
|
||||||
Libraries
|
Libraries
|
||||||
@@ -45,9 +46,9 @@ problem of running slower algorithms on Python by using multidimensional arrays
|
|||||||
and functions that operate on arrays. Any algorithm can then be expressed as a
|
and functions that operate on arrays. Any algorithm can then be expressed as a
|
||||||
function on arrays, allowing the algorithms to be run quickly.
|
function on arrays, allowing the algorithms to be run quickly.
|
||||||
|
|
||||||
|
|
||||||
NumPy is part of the SciPy project, and is released as a separate library so
|
NumPy is part of the SciPy project, and is released as a separate library so
|
||||||
people who only need the basic requirements can just use NumPy.
|
people who only need the basic requirements can use it without installing the
|
||||||
|
rest of SciPy.
|
||||||
|
|
||||||
NumPy is compatible with Python versions 2.4 through to 2.7.2 and 3.1+.
|
NumPy is compatible with Python versions 2.4 through to 2.7.2 and 3.1+.
|
||||||
|
|
||||||
@@ -56,60 +57,62 @@ Numba
|
|||||||
|
|
||||||
`Numba <http://numba.pydata.org>`_ is an Numpy aware Python compiler
|
`Numba <http://numba.pydata.org>`_ is an Numpy aware Python compiler
|
||||||
(just-in-time (JIT) specializing compiler) which compiles annotated Python (and
|
(just-in-time (JIT) specializing compiler) which compiles annotated Python (and
|
||||||
Numpy) code to LLVM (Low Level Virtual Machine) (through special decorators).
|
Numpy) code to LLVM (Low Level Virtual Machine) through special decorators.
|
||||||
Briefly, Numba using system that compiles Python code with LLVM to code which
|
Briefly, Numba uses a system that compiles Python code with LLVM to code which
|
||||||
can be natively executed at runtime.
|
can be natively executed at runtime.
|
||||||
|
|
||||||
SciPy
|
SciPy
|
||||||
-----
|
-----
|
||||||
|
|
||||||
`SciPy <http://scipy.org/>`_ is a library that uses Numpy for more mathematical
|
`SciPy <http://scipy.org/>`_ is a library that uses NumPy for more mathematical
|
||||||
functions. SciPy uses NumPy arrays as the basic data structure. SciPy comes
|
functions. SciPy uses NumPy arrays as the basic data structure, and comes
|
||||||
with modules for various commonly used tasks in scientific programming, for
|
with modules for various commonly used tasks in scientific programming,
|
||||||
example: linear algebra, integration (calculus), ordinary differential equation
|
including linear algebra, integration (calculus), ordinary differential equation
|
||||||
solvers and signal processing.
|
solving and signal processing.
|
||||||
|
|
||||||
Matplotlib
|
Matplotlib
|
||||||
----------
|
----------
|
||||||
|
|
||||||
`Matplotlib <http://matplotlib.sourceforge.net/>`_ is a flexible plotting
|
`Matplotlib <http://matplotlib.sourceforge.net/>`_ is a flexible plotting
|
||||||
library for creating interactive 2D and 3D plots that can also be saved as
|
library for creating interactive 2D and 3D plots that can also be saved as
|
||||||
manuscript-quality figures. The API in many ways reflects that of `MATLAB
|
manuscript-quality figures. The API in many ways reflects that of `MATLAB
|
||||||
<http://www.mathworks.com/products/matlab/>`_, easing transition of MATLAB
|
<http://www.mathworks.com/products/matlab/>`_, easing transition of MATLAB
|
||||||
users to Python. Many examples, along with the source code to re-create them,
|
users to Python. Many examples, along with the source code to re-create them,
|
||||||
can be browsed at the `matplotlib gallery
|
are available in the `matplotlib gallery
|
||||||
<http://matplotlib.sourceforge.net/gallery.html>`_.
|
<http://matplotlib.sourceforge.net/gallery.html>`_.
|
||||||
|
|
||||||
Pandas
|
Pandas
|
||||||
------
|
------
|
||||||
|
|
||||||
`Pandas <http://pandas.pydata.org/>`_ is data manipulation library
|
`Pandas <http://pandas.pydata.org/>`_ is data manipulation library
|
||||||
based on Numpy and which provides many useful functions for accessing,
|
based on Numpy which provides many useful functions for accessing,
|
||||||
indexing, merging and grouping data easily. The main data structure (DataFrame)
|
indexing, merging and grouping data easily. The main data structure (DataFrame)
|
||||||
is close to what could be found in the R statistical package, that is
|
is close to what could be found in the R statistical package; that is,
|
||||||
an heterogeneous data tables with name indexing, time series operations
|
heterogeneous data tables with name indexing, time series operations and
|
||||||
and auto-alignment of data.
|
auto-alignment of data.
|
||||||
|
|
||||||
Rpy2
|
Rpy2
|
||||||
----
|
----
|
||||||
|
|
||||||
`Rpy2 <http://rpy.sourceforge.net/rpy2.html>`_ is a Python binding for the R
|
`Rpy2 <http://rpy.sourceforge.net/rpy2.html>`_ is a Python binding for the R
|
||||||
statistical package allowing to execute R functions from Python and passing
|
statistical package allowing the execution of R functions from Python and passing
|
||||||
data back and forth the two environments. Rpy2 is the object oriented
|
data back and forth between the two environments. Rpy2 is the object oriented
|
||||||
implementation of the binding based on `Rpy <http://rpy.sourceforge.net/rpy.html>`_.
|
implementation of the `Rpy <http://rpy.sourceforge.net/rpy.html>`_ bindings.
|
||||||
|
|
||||||
PsychoPy
|
PsychoPy
|
||||||
--------
|
--------
|
||||||
|
|
||||||
`PsychoPy <http://www.psychopy.org/>`_ is a library for cognitive scientists
|
`PsychoPy <http://www.psychopy.org/>`_ is a library for cognitive scientists
|
||||||
allowing to create cognitive psychology and neuroscience experiments. The library
|
allowing the creation of cognitive psychology and neuroscience experiments.
|
||||||
handles both presentation of stimuli, scripting of experimental design and
|
The library handles presentation of stimuli, scripting of experimental design
|
||||||
data collection.
|
and data collection.
|
||||||
|
|
||||||
|
|
||||||
Resources
|
Resources
|
||||||
:::::::::
|
:::::::::
|
||||||
|
|
||||||
Installation of scientific Python packages can be troublesome. Many of these
|
Installation of scientific Python packages can be troublesome, as many of
|
||||||
packages are implemented as Python C extensions which need to be compiled.
|
these packages are implemented as Python C extensions which need to be compiled.
|
||||||
This section lists various so-called scientific Python distributions which
|
This section lists various so-called scientific Python distributions which
|
||||||
provide precompiled and easy-to-install collections of scientific Python
|
provide precompiled and easy-to-install collections of scientific Python
|
||||||
packages.
|
packages.
|
||||||
@@ -117,27 +120,27 @@ packages.
|
|||||||
Unofficial Windows Binaries for Python Extension Packages
|
Unofficial Windows Binaries for Python Extension Packages
|
||||||
---------------------------------------------------------
|
---------------------------------------------------------
|
||||||
|
|
||||||
Many people who do scientific computing are on Windows. And yet many of the
|
Many people who do scientific computing are on Windows, yet many of the
|
||||||
scientific computing packages are notoriously difficult to build and install.
|
scientific computing packages are notoriously difficult to build and install
|
||||||
`Christoph Gohlke <http://www.lfd.uci.edu/~gohlke/pythonlibs/>`_ however, has
|
on this platform. `Christoph Gohlke <http://www.lfd.uci.edu/~gohlke/pythonlibs/>`_
|
||||||
compiled a list of Windows binaries for many useful Python packages. The list
|
however, has compiled a list of Windows binaries for many useful Python packages.
|
||||||
of packages has grown from a mainly scientific Python resource to a more
|
The list of packages has grown from a mainly scientific Python resource to a more
|
||||||
general list. It might be a good idea to check it out if you're on Windows.
|
general list. If you're on Windows, you may want to check it out.
|
||||||
|
|
||||||
Anaconda
|
Anaconda
|
||||||
--------
|
--------
|
||||||
|
|
||||||
`Continuum Analytics <http://continuum.io/>`_ offers the `Anaconda
|
`Continuum Analytics <http://continuum.io/>`_ offers the `Anaconda
|
||||||
Python Distribution <https://store.continuum.io/cshop/anaconda>`_ which
|
Python Distribution <https://store.continuum.io/cshop/anaconda>`_ which
|
||||||
includes all the common scientific Python packages and additionally many
|
includes all the common scientific Python packages as well as many packages
|
||||||
packages related to data analytics and big data. Anaconda itself is free, and
|
related to data analytics and big data. Anaconda itself is free, and
|
||||||
Continuum sells a number of proprietary add-ons. Free
|
Continuum sells a number of proprietary add-ons. Free licenses for the
|
||||||
licenses for the add-ons are available for academics and researchers.
|
add-ons are available for academics and researchers.
|
||||||
|
|
||||||
Canopy
|
Canopy
|
||||||
------
|
------
|
||||||
|
|
||||||
`Canopy <https://www.enthought.com/products/canopy/>'_ is another scientific Python
|
`Canopy <https://www.enthought.com/products/canopy/>`_ is another scientific
|
||||||
distribution, produced by `Enthought <https://www.enthought.com/>`_. A limited
|
Python distribution, produced by `Enthought <https://www.enthought.com/>`_.
|
||||||
'Canopy Express' variant is available for free, and Enthought charge for the
|
A limited 'Canopy Express' variant is available for free, but Enthought
|
||||||
full distribution. Free licenses are available for academics.
|
charges for the full distribution. Free licenses are available for academics.
|
||||||
|
|||||||
Reference in New Issue
Block a user