NumPy is designed for manipulating multi-dimensional arrays
These arrays are dynamic in size
Unlike lists, they must contain all of the same data type
Given a list, you can wrap it into an array
alist = [1,2,3]
np.array(axlist)A subclass of arrays
Python's built-in math library doesn't know how apply something like cos to arrays
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
if you want a matrix whose entries are written in terms i and j, you can build that pretty quickly with this array
# make a matrix with whose entries are the products of the indices
dim = (m,n)
A = np.indices(dim)
# we have mat[i,j] = A[0, i, j] * A[1, i, j], which can be coded as
mat = np.prod(A, axis=0)