Tools/Python Tools
(→matplotlib) |
|||
Line 64: | Line 64: | ||
</source> | </source> | ||
− | ===== | + | == Modules == |
+ | |||
+ | === NumPy === | ||
['''Num'''erical '''Py'''thon] | ['''Num'''erical '''Py'''thon] | ||
Line 72: | Line 74: | ||
[http://sourceforge.net/projects/numpy/files/ Download NumPy] | [http://sourceforge.net/projects/numpy/files/ Download NumPy] | ||
− | + | === SciPy === | |
[http://www.scipy.org/ '''Sci'''entific Library for '''Py'''thon] | [http://www.scipy.org/ '''Sci'''entific Library for '''Py'''thon] | ||
Line 80: | Line 82: | ||
[http://sourceforge.net/projects/scipy/files/ Download SciPy] | [http://sourceforge.net/projects/scipy/files/ Download SciPy] | ||
− | + | === matplotlib === | |
Install the newest version (v1.2.1 is NOT recommended) of [http://matplotlib.org/downloads.html matplotlib] | Install the newest version (v1.2.1 is NOT recommended) of [http://matplotlib.org/downloads.html matplotlib] | ||
Line 86: | Line 88: | ||
Check out the [http://matplotlib.org/faq/usage_faq.html#coding-styles Usage FAQ: Coding Styles] for a short introduction to plotting with [http://matplotlib.org/ matplotlib]. For full documentation go to the [http://matplotlib.org/api/index.html API documentation]. | Check out the [http://matplotlib.org/faq/usage_faq.html#coding-styles Usage FAQ: Coding Styles] for a short introduction to plotting with [http://matplotlib.org/ matplotlib]. For full documentation go to the [http://matplotlib.org/api/index.html API documentation]. | ||
− | [[Category:Install]] | + | === SymPy === |
+ | |||
+ | [http://docs.sympy.org/ '''Sym'''bolic Mathematics with '''Py'''thon] | ||
+ | |||
+ | Try out [http://live.sympy.org/ SymPy Live] directly in your browser to get a feeling of it. | ||
+ | |||
+ | [[Category:Install]] [[Category:Python]] |
Revision as of 16:29, 6 May 2013
|
Python can be used to achieve results similar to Octave or Matlab, but with the advantages of a fundamentally object-oriented general-purpose language. Additionally to numerical computation, packages allow to solve linear systems.
Numerical computation with Python mainly bases on the following libraries:
- NumPy for arrays, linear algebra, ...
- SciPy depends on NumPy, used to manipulate numbers, for signal processing, ...
- matplotlib for 2D plots
PyLab integrates these 3 libraries.
The Spyder IDE provides a MATLAB-like development interface. As a simple alternative, IPython provides a web-based GUI and Mathematica-like notebooks.
Installation
Mac OS
Donload Spyder.
Copy the application to the Applications
folder.
Launch Spyder
, and in the console type:
t = linspace(0, 10, 100); plot(t, sin(t));
Linux
Installation can be done on a package basis, with pip. An alternative would be easy_install.
Install the IDE:
sudo apt-get install spyder
This also installs numPy
, sciPy
and matplotlib
.
Launch Spyder
, and in the console type:
t = linspace(0, 10, 100); plot(t, sin(t));
Windows
Download Python(x,y) to install Python and other components of your choice.
Python(x,y) 2.7.3.1
During the installation make sure to have pip selected in the list of available Python modules.
Spyder IDE
Spyder (Scientific PYthon Development EnviRonment) is an IDE similar to the one you get with Matlab or Octave. This means you get an editor, a console, online help, variable explorer and much more. With Python(x,y) 2.7.3.1 you get Spyder v. 2.1.11. We recommend however to upgrade to the newest version.
First you have to remove the old one first.
pip uninstall spyder
and then install the newest Spyder (at the time of writing this: v. 2.2.0rc) with
pip install spyder
Modules
NumPy
[Numerical Python]
SciPy
matplotlib
Install the newest version (v1.2.1 is NOT recommended) of matplotlib
Check out the Usage FAQ: Coding Styles for a short introduction to plotting with matplotlib. For full documentation go to the API documentation.
SymPy
Symbolic Mathematics with Python
Try out SymPy Live directly in your browser to get a feeling of it.