This is documentation for an old release of Scikit-learn (version 0.21). Try the latest stable release (version 1.6) or development (unstable) versions.
This is documentation for an old release of Scikit-learn (version 0.21). Try the latest stable release (version 1.6) or development (unstable) versions.
sklearn.utils.sparsefuncs
.inplace_swap_row¶
-
sklearn.utils.sparsefuncs.
inplace_swap_row
(X, m, n)[source]¶ Swaps two rows of a CSC/CSR matrix in-place.
Parameters: - X : CSR or CSC sparse matrix, shape=(n_samples, n_features)
Matrix whose two rows are to be swapped.
- m : int
Index of the row of X to be swapped.
- n : int
Index of the row of X to be swapped.