This document will usually refer to numpy functions by their simple names, so numpy.reshape will just be called reshape. This is the syntax you would use if your module usues "from numpy import *". Many MIEN modules do use that syntax, although there are good arguments for using "import numpy as N" instead. In the latter case you will need to use "N.reshape" when this site says "reshape"
Numpy arrays (Narrays) in 1D have the same slicing rules as other python collections. A[x:y] returns the elements of a in the left-closed,right-open interval [x,y) (x,x+1, ... y-1).
Narrays can also accept other arrays and collections as indexes. A[B] returns the elements of A at the indexes specified in the integer array B
Narrays in multiple dimensions use commas to separate slices for each dimension. A[x:y,z:w] returns rows [x,y) of columns [z, w).
As usual omitting either index uses the largest possible range, and specifying just a ":" means the entire range. A[:,:3] means all rows of columns 0,1, and 2.
Unlike ptyhon lists, slices of arrays are references, not copies. Modifying the slice modifies the origional array too.
A.shape is a tuple containing the lengths of every dimension in A. Unlike Matlab, 1D arrays are really 1D. They don't have shape (N,1) or (1,N), they have shape (N,). In some contexts they are treated as column vectors. If you need to be sure that they are row or column vectors, reshape them: rA=reshape(A, (1,-1))
Arrays have a complicated set of rules of "broadcast" specifying what to do if a basic operatior is applyed to an array and a scalar, or arrays of differents shapes. The simplest case is if one element is a scalar. In this case every element in the array is operated on element-wise. A*3 returns an array where every element in A has benn multiplied by 3. (Note: because of their size, arrays use the "shortcut" opperators differently than other python objects. A*=3 multiplies every element of A by three in place. This can save lots of memory, but it will modify any elemnts or slices of the origional name A).
Ararys of the same shape operate elementwise. A*B returns every elment of A multiplied by the elemnt of B at the same set of indexes.
In general, broadcast works on arrays of different shape if all the differing dimensions are length 1 in one of the arrays. A*B works if a is shape (6,5) and B is shape (6,1). The result is every column in A multiplied element-wise by B. The easiest way to pick up broadcast is to use the interactive interpretter, make some arrays, and play around:
I'm not sure if this still applies in recent versions, but it used to be the case that using array methods, when possible, was faster than using functions, so std(A, 1) and A.std(1) return the same result (the standard deviation of A along the second axis - the first axis would be a.std(0) and across all elemnts of the entire array would be a.std()), the method would be faster. In many cases the same things can be done with functions and methods. I'll report the methods I tend to use and the functions I tend to use. This may not be with best way to do things, since I learned in an early version of Numeric, then used a pre-1.0 version of and nummaray for years, and still have some legacy bad habits.