def scale(data_matrix): """returns the mean and standard deviations of each column""" num_rows, num_cols = algebra.shape(data_matrix) means = [stats.mean(algebra.get_column(data_matrix, j)) for j in range(num_cols)] stddevs = [stats.standard_deviation(algebra.get_column(data_matrix, j)) for j in range(num_cols)] return means, stddevs
def scale(data_matrix): """returns the mean and standard deviations of each column""" num_rows, num_cols = algebra.shape(data_matrix) means = [ stats.mean(algebra.get_column(data_matrix, j)) for j in range(num_cols) ] stddevs = [ stats.standard_deviation(algebra.get_column(data_matrix, j)) for j in range(num_cols) ] return means, stddevs
def matrix_entry(i, j): return stats.correlation(algebra.get_column(data, i), algebra.get_column(data, j))