iCLIP.meta.compress_matrix

iCLIP.meta.compress_matrix(matrix, nrows=None, ncols=None)

Compress a matrix to a new number of rows/columns. Cells in the matrix are collapsed by averaging. Assumes matrix is sorted

Parameters:
  • matrix (pandas.DataFrame) – matrix to be compressed. Index(s) must be numeric.
  • nocls (nrows,) – Number of rows/columns in the output matrix. If None then will be same as input matrix.
Returns:

If nrows/ncols is None then the corresponding index will be unchanged. Otherwise, index will be integer 0 to nrows/ncols .

Return type:

pandas.DataFrame