Toggle Menu
Prev Up Next

scikit-learn 1.3.2
Other versions

Please cite us if you use the software.

# `sklearn.utils`.indexable

sklearn.utils.indexable(*iterables)

  Make arrays indexable for cross-validation.

  Checks consistent length, passes through None, and ensures that everything can be indexed by converting sparse matrices to csr and converting non-interable objects to arrays.

  Parameters:
    *iterables{lists, dataframes, ndarrays, sparse matrices}

      List of objects to ensure sliceability.

  Returns:
    result list of {ndarray, sparse matrix, dataframe} or None

      Returns a list containing indexable arrays (i.e. NumPy array, sparse matrix, or dataframe) or `None`.