from numpy import *

#n equations with n unknowns

#http://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.solve.html

#Solve the system of equations 3 * x0 + x1 = 9 and x0 + 2 * x1 = 8:

#[3 1][x0      = [9
#[1 2] x1]     =  8]



#ax = b
a = array([[3,1], [1,2]])
b = array([9,8])
x = linalg.solve(a, b)


print dot(a, x) # should be b



#m equations with n unknows, m>n