def matrix_IQR(x):
 num_cols = x.shape[1]
 min_vals = zeros(num_cols)
 max_vals = zeros(num_cols)
 for i in range(x.shape[1]):
  col = x[:, i]
  (min_vals[i], max_vals[i]) = IQR(col)
 return (min_vals, max_vals)

def matrix_IQR ( x ) : num_cols = x . shape [ 1 ] min_vals = zeros ( num_cols ) max_vals = zeros ( num_cols ) for i in range ( x . shape [ 1 ] ) : col = x [ : , i ] ( min_vals [ i ] , max_vals [ i ] ) = IQR ( col ) return ( min_vals , max_vals )
calculates the iqr for each column in an array .