Tools/Python Tools

(Difference between revisions)
Jump to: navigation, search
(matplotlib)
(Windows)
Line 52: Line 52:
 
Download [https://code.google.com/p/pythonxy/ Python(x,y)] to install [http://www.python.org/ Python] and other components of your choice.
 
Download [https://code.google.com/p/pythonxy/ Python(x,y)] to install [http://www.python.org/ Python] and other components of your choice.
  
==== [https://code.google.com/p/pythonxy/ Python(x,y)] 2.7.3.1 ====
+
==== [https://code.google.com/p/pythonxy/ Python(x,y)] 2.7.5.0 ====
  
In the ''Choose Components'' window of the installation  make sure to have ''Python''->''Pip'' selected. ''Pip'' is needed to do the upgrades of the packages as described below. Select also ''Python''->''SymPy'' if you need it. Additional modules can easily be added later by re-running the installer and selecting the desired module(s).
+
In the ''Choose Components'' window of the installer select ''Python''->''SymPy'' if you need it.
 +
Additional modules can easily be added later by re-running the installer and selecting the desired module(s).
  
 
===== [http://code.google.com/p/spyderlib/ Spyder] IDE =====
 
===== [http://code.google.com/p/spyderlib/ Spyder] IDE =====
  
[http://code.google.com/p/spyderlib/ '''S'''cientific '''PY'''thon '''D'''evelopment '''E'''nvi'''R'''onment] 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.
+
[http://code.google.com/p/spyderlib/ '''S'''cientific '''PY'''thon '''D'''evelopment '''E'''nvi'''R'''onment] 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, debugger with breakpoints and much more.
  
With ''[https://code.google.com/p/pythonxy/ Python(x,y)] 2.7.3.1'' you get ''[http://code.google.com/p/spyderlib/ Spyder]v. 2.1.11''. We recommend however to upgrade to the newest version.
+
With ''[https://code.google.com/p/pythonxy/ Python(x,y)] 2.7.5.0'' you get ''[http://code.google.com/p/spyderlib/ Spyder] v. 2.2.0''.
 
+
If you installed [https://code.google.com/p/pythonxy/ Python(x,y)] correctly the commands below should work in any console. If [https://github.com/pypa/pip#readme pip] is an unknown command, make sure that you have ''C:\Python27\Scripts'' in the ''Path'' environment variable.
+
 
+
First you have to remove the old [http://code.google.com/p/spyderlib/ Spyder] first
+
 
+
<source lang='DOS'>
+
pip uninstall spyder
+
</source>
+
 
+
and then install the newest version (at the time of writing this: v. 2.2.0) with
+
 
+
<source lang='DOS'>
+
pip install spyder
+
</source>
+
  
 
== Modules ==
 
== Modules ==

Revision as of 08:14, 11 June 2013

Contents

Modules

For our scientific purposes we use following modules regularly:

PyLab is an effort to consolidate following libraries together with IPython into a compelling environment for numerical computation:

  • NumPy for arrays, linear algebra, ...
  • SciPy depends on NumPy, used to manipulate numbers, for signal processing, ...
  • matplotlib for 2D plots

Symbolic mathematics can be done with:

IDEs

The Spyder IDE provides a complete MATLAB-like development interface. As a simple alternative, IPython provides a web-based GUI and Mathematica-like notebooks.

Installation

Mac OS

Download 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.5.0

In the Choose Components window of the installer select Python->SymPy if you need it. Additional modules can easily be added later by re-running the installer and selecting the desired module(s).

Spyder IDE

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, debugger with breakpoints and much more.

With Python(x,y) 2.7.5.0 you get Spyder v. 2.2.0.

Modules

Pip

pip is a tool for installing and managing Python packages.

pip Documentation

NumPy

Numerical Python

NumPy Reference Documentation

Update by downloading the newest version.

SciPy

Scientific Library for Python

SciPy Reference Documentation

Update by downloading the downloading the newest version.

matplotlib

matplotlib python 2D plotting library

Check out the Usage FAQ: Coding Styles for a short introduction to plotting with matplotlib.For full documentation go to the API documentation.

Update by downloading the downloading the newest version.

Note 1: v1.2.1 is NOT recommended!

Note 2: As matplotlib depends on NumPy, update NumPy before matplotlib!

SymPy

Symbolic Mathematics with Python

Try out SymPy Live directly in your browser to get a feeling of it or read through the [http://docs.sympy.org/0.7.2/index.html documentation.

Personal tools
Namespaces
Variants
Actions
Navigation
Browse
Toolbox