Arrays in Python

One of the first hurdles with doing data process in python is the format of the data. Our data naturally exists in rows and matrixes, but Python generally only allows us to work with one variable at a time. We can use for loops, list comprehensions, and a variety of other tools, but wouldn’t it be nice if we could simplify everything?

Using NumPy we can work directly with arrays and matrixes rather than with the individual values. It also provides a variety of tools for simple data processing.

The best way to install NumPy starts by installing setuptools. Once setuptools is installed (using the directions for your specific platform) run:

 easy_install numpy

After it finishes installing, you will see the following messages:

Processing dependencies for numpy
Finished processing dependencies for numpy

Now you can import numpy with one of the following commands:

from numpy import *
import numpy

A good description of the package along with the full documentation can be found online, and I’ll be providing some examples of common functions in a later edition.

This entry was posted in Uncategorized. Bookmark the permalink.

Error: The ad management script is not properly configured for this user

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>