W3cubDocs

/scikit-learn

sklearn.utils.safe_indexing

sklearn.utils.safe_indexing(X, indices) [source]

Return items or rows from X using indices.

Allows simple indexing of lists or arrays.

Parameters:
X : array-like, sparse-matrix, list, pandas.DataFrame, pandas.Series.

Data from which to sample rows or items.

indices : array-like of int

Indices according to which X will be subsampled.

Returns:
subset

Subset of X on first axis

Notes

CSR, CSC, and LIL sparse matrices are supported. COO sparse matrices are not supported.

© 2007–2018 The scikit-learn developers
Licensed under the 3-clause BSD License.
http://scikit-learn.org/stable/modules/generated/sklearn.utils.safe_indexing.html