Initial commit.
#!/usr/bin/python
import pylab as pl
def move(b, nonred, maxi):
""" """
br, bc = pl.atleast_2d(b).shape
b = pl.hstack((b, pl.zeros((br, len(nonred)-bc))))
maxi = max(max(nonred)+1, maxi)
result = pl.zeros((br, maxi))
nonred = pl.array(nonred)
result[:,nonred.T]=b
return result
if __name__== "__main__":
s = """b = pl.array([[1, 2],
[9, 10]])"""
t = """nonred = pl.array([7, 2])"""
u = """maxi = 10"""
print s, t, u
exec(s)
exec(t)
exec(u)
print """move(b, nonred, maxi)"""
print move(b, nonred, maxi)