python numpy

References

Summary

NumPy is designed for manipulating multi-dimensional arrays

These arrays are dynamic in size

ndarrays

Unlike lists, they must contain all of the same data type

Creating Arrays

Given a list, you can wrap it into an array

alist = [1,2,3]
np.array(axlist)

Record Arrays

Matrices

A subclass of arrays

Math

Python's built-in math library doesn't know how apply something like cos to arrays

np.indices

Notoriously confusing, I think I'm starting to get what it is

If you take, say (m,n) as dimensions, and do

A = numpy.indices((m,n))

what you'll get is an array with dimensions 2 x m x n And in particular, the entry

(A[0, i, j], A[1, i, j]) == (i,j)

What is the purpose of this? I don't really know

But here's something you can do with it