SciPy

scipy.sparse.bsr_matrix.eliminate_zeros

bsr_matrix.eliminate_zeros()[source]

Remove zero elements in-place.