'Returns the submatrix corresponding to bicluster `i`.
Parameters
i : int
The index of the cluster.
data : array
The data.
Returns
submatrix : array
The submatrix corresponding to bicluster i.
Notes
Works with sparse matrices. Only works if ``rows_`` and
``columns_`` attributes exist.'

def get_submatrix(self, i, data):

    from .utils.validation import check_array
    data = check_array(data, accept_sparse='csr')
    (row_ind, col_ind) = self.get_indices(i)
    return data[(row_ind[:, np.newaxis], col_ind)]
