GIS Logo GSP 118 (318): GIS Programming

Statistics with NumPy

Note: There are excellent tutorials on the scipy.org wiki web site and the examples for Matplotlib are a great way to get started with plotting. However, the imports are no longer correct for the latest versions of Matplotlib as "matplotlib.numerix" needs to change to "numpy". Be ready for similar types of errors as you dive into other packages.

 

NumPy and SciPy

NumPy is a vector (array) and matrix based analytical package for Python and is widely used for analysis. NumPy is closely associated, and delivered with, SciPy.

Note: The last time I tried to instal SciPy with Python 2.7 it kept generating errors. I finally installed Python 3.3 and was able to install the "scipy-stack" from http://www.lfd.uci.edu/~gohlke/pythonlibs/. Welcome to Python packages!

You can download NumPy from www.scipy.org. SciPy relies on NumPy so you will want to install it first and then install SciPy if needed.

Fortunately, there are excellent tutorials and extensive examples for NumPy so I will just reference two here:

Tutorial to get started in NumPy - start here

Examples - Check out the example on linear regression and others

MatPlotLib

MatplotLib is a library for science-based charting and can be downloaded from matplotlib.org.

Examples: