code: def image2array(image):
      
      nx, ny = image.shape  # find the size of the array
      imgh = np.reshape(image, nx*ny)  # change the shape to be 1d
      return imgh
docs: returns the information contained in a 2d array into an n*n 1d array
  
      :param array: image values
      :type array: array of size (n,n)
      :returns:  1d array
      :raises: AttributeError, KeyError