Numpy.corrcoef() for twice one object does not return matrix of 1's I'm trying to compare if two pictures are similar or close to similar. The picture is available as numpy.ndarray and contains of 28x28 pixels. It might look like the one below: 

When I get the image as numpy.ndarray and calculate the corrcoef
image = data['test_dataset'][0]
matrix = np.corrcoef(image, image)

I was expecting a matrix full of 1's. Instead I get as print(matrix) something like:
[[ 1.          0.88450496  0.71112943 ...,  0.38349944  0.86398242
   0.95855052]
 [ 0.88450496  1.          0.85582039 ...,  0.60284577  0.99192916
   0.85438787]
...

Afterwards I wanted to create the .mean() of the matrix and if the value is higher than for example 0.98 the images are similar.
Can someone help me getting a matrix full of 1's instead of my strange looking output? Thanks in advance.
 A: You cannot have a matrix full of 1's, only the diagonal will be (except if you have an image with identical rows).
From the numpy documentation of the first passed argument 
x : array_like
A 1-D or 2-D array containing multiple variables and observations. Each row of x represents a variable, and each column a single observation of all those variables.
So in your result matrix, the coefficient appearing in position [0, 0] is the correlation of the first row of the image with itself (should be equal to 1, which is the case)
The coefficient appearing in position [0, 1] is the correlation between the first row and the second row of the image and cannot be equal to 1 as these rows are clearly not identical. It should however be equal to the coefficient in position [1, 0] which is the case.
So the function seems to work well. You cannot calculate the correlation of one pixel with respect to one other pixel because it doesn't make sense. You need a time-series to have variations and correlations.
