def scale(dataMatrix): nRows, nCols = shape(dataMatrix) means = [mean(getCol(dataMatrix, j)) for j in range(nCols)] stdevs = [stdDeviation(getCol(dataMatrix, j)) for j in range(nCols)] return means, stdevs
def matrix_product_entry(A, B, i, j): return dotProduct(getRow(A, i), getCol(B, j))
def matrixEntry(i, j): return correlation(getCol(data, i), getCol(data, j))