Tools/Python Tools

From UIT
Revision as of 15:47, 24 January 2014 by Guo (Talk | contribs)
Jump to: navigation, search

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 Scientific PYthon Development EnviRonment (Spyder) IDE provides a complete MATLAB/Octave-like development interface.This means you get an editor, a console, online help, variable explorer, debugger with breakpoints and much more.

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

We recommend to use the free and open-source WinPython Python distribution. It is portable in the sense, that it will not write anything to the Windows registry and everything is stored in the installation folder. This means that you can copy or move the installation folder anytime to any location (local, network or removable drive) with most of the application settings. You are even able to have multiple Python distributions installed on one machine (see also Roadmap).

There are 32-bit or 64-bit installers (depending on your operating system) for

We do NOT recommend to install it to C:\Program Files or any similar folder, as you need administrator privileges to execute it there.

To install additional packages or upgrade existing ones, use the WinPython Control Panel.

Spyder is already provided with WinPython.

Launch Spyder, and in the console type:

t = linspace(0, 10, 100);
plot(t, sin(t));

Modules

Pip

pip is a tool for installing and managing Python packages.

pip Documentation

NumPy

Numerical Python

NumPy Reference Documentation

Update by downloading the latest version.

SciPy

Scientific Library for Python

SciPy Reference Documentation

Update by downloading the latest 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 latest version.

Note 1: 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 documentation.

Personal tools
Namespaces
Variants
Actions
Navigation
Browse
Toolbox