Here's the question and the example given:
You are given a 2-d array A of size NxN containing floating-point numbers. The array represents pairwise correlation between N elemenets with A[i,j] = A[j,i] = corr(i,j) and A[i,i] = 1.
Write a Python program using NumPy to find the index of the highest correlated element for each element and finally print the sum of all these indexes.
Example: The array A = [[1, 0.3, 0.4], [0.4,1,0.5],[0.1,0.6,1]]. Then, the indexes of the highest correlated elements for each element are [3, 3, 2]. the sum of these indexes is 8.
I'm having trouble understanding the question, but the example makes my confusion worse. With each array inside A having only 3 values, and A itself having only three arrays inside how can any "index of the highest correlated elements" being greater than 2 if numpy is zero indexed?
Does anyone understand the question?
A[i, j] == A[j, i], but that's not true in the example.1.