In [2]:
import matplotlib.pyplot as plt
import numpy as np

# image data
a = np.array([0.313660827978, 0.365348418405, 0.423733120134,
              0.365348418405, 0.439599930621, 0.525083754405,
              0.423733120134, 0.525083754405, 0.651536351379]).reshape(3,3)


Out[2]:
array([[ 0.31366083,  0.36534842,  0.42373312],
       [ 0.36534842,  0.43959993,  0.52508375],
       [ 0.42373312,  0.52508375,  0.65153635]])