Toggle Menu
Prev Up Next

scikit-learn 1.3.2
Other versions

Please cite us if you use the software.

# `sklearn.utils.sparsefuncs`.inplace_swap_row

sklearn.utils.sparsefuncs.inplace_swap_row(X, m, n)

  Swap two rows of a CSC/CSR matrix in-place.

  Parameters:
    X sparse matrix of shape (n_samples, n_features)

      Matrix whose two rows are to be swapped. It should be of CSR or CSC format.

    m int

      Index of the row of X to be swapped.

    n int

      Index of the row of X to be swapped.