def read_array(filename): ''' Read array and convert to 2d np arrays ''' array = np.genfromtxt(filename, dtype=float) if len(array.shape)==1: array = array.reshape( -1, 1 ) return array