Numpy array structural operation examples

Here are some numpy array structural opreation examples:

import numpy as N
 a = (1 + N.arange(4))**2
 array([ 1, 4, 9, 16])
N.take(a, [2, 2, 0, 1])
array([9, 9, 1, 4])

N.where(a >= 2, a, -1)
array([-1, 4, 9, 16])

N.reshape(a, (2, 2))
array([[ 1, 4],
[ 9, 16]])

N.resize(a, (3, 5))
array([[ 1, 4, 9, 16, 1],
[ 4, 9, 16, 1, 4],
[ 9, 16, 1, 4, 9]])

N.repeat(a, [2, 0, 2, 1])
array([ 1, 1, 9, 9, 16])