sklearn.utils.sparsefuncs.inplace_swap_column

sklearn.utils.sparsefuncs.inplace_swap_column(X, m, n) [source]

Swaps two columns of a CSC/CSR matrix in-place.

Parameters
Xsparse matrix of shape (n_samples, n_features)

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

mint

Index of the column of X to be swapped.

nint

Index of the column of X to be swapped.

© 2007–2020 The scikit-learn developers
Licensed under the 3-clause BSD License.
https://scikit-learn.org/0.24/modules/generated/sklearn.utils.sparsefuncs.inplace_swap_column.html