a = np.array([[0.99845902, -0.70780512, 0.26981375, -0.6077122, 0.09639695],
    [0.61856711, -0.74684913, 0.20099992, 0.99725171, -0.41826754], [
    0.79964397, 0.56620812, -0.64055346, -0.50572793, -0.50100635]])
out_f = cStringIO.StringIO()
np.savetxt(out_f, a, delimiter=',')
out_f.getvalue()
Storing and loading numpy arrays as files