you can expand your matrix:
>> import numpy >> import pickle >> b=numpy.matrix('1 2; 3 4') >> f=open('test','w') >> pickle.dump(b, f) >> f.close() >> f2 = open('test', 'r') >> s = pickle.load(f2) >> f2.close() >> s matrix([[1, 2], [3, 4]])
Tamas answer is much better than this: numpy matrixes objects have a direct method for sorting them.
In any case, keep in mind that the pickle library is a general tool for saving python objects, including classes.
joaquin
source share