def correlation_matrix(data):
 (_, num_columns) = shape(data)
 def matrix_entry(i, j):
  return correlation(get_column(data, i), get_column(data, j))
 return make_matrix(num_columns, num_columns, matrix_entry)

def correlation_matrix ( data ) : ( _ , num_columns ) = shape ( data ) def matrix_entry ( i , j ) : return correlation ( get_column ( data , i ) , get_column ( data , j ) ) return make_matrix ( num_columns , num_columns , matrix_entry )
returns the num_columns x num_columns matrix whose th entry is the correlation between columns i and j of data .