[SPARK-2786][mllib] Python correlations

iterator is slow. `Array.tabulate(matrix.numRows, matrix.numCols)((i, j) => values(i + j * matrix.numRows))` may be faster.