You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
_safe_indexing being the only *private* thing listed in classes.rst #27439
Historically, _safe_indexing was public and we made it private. Over the last few years, _safe_inexing behavior has changed slightly from version to version so it's not stable in that sense.
Given how often we use _safe_indexing internally, a public _safe_indexing would be useful for third party libraries.
+0 (can live either way)
A few thoughts: Maybe the fact that we internally use it very often is an indication that should not make it public. Indexing does not seem to be something that scikit-learn should fix, IMO. On the other side, many projects seem to import it even if it's not public.
The difficult part about it is the mix between Array API and Dataframes. The latter alone can be done with narwhals.
Activity
glemaitre commentedon Sep 22, 2023
I would like to have public in the way that I want this function to be considered as a developer functions.
thomasjpfan commentedon Nov 25, 2023
Historically,
_safe_indexingwas public and we made it private. Over the last few years,_safe_inexingbehavior has changed slightly from version to version so it's not stable in that sense.Given how often we use
_safe_indexinginternally, a public_safe_indexingwould be useful for third party libraries.adrinjalali commentedon Dec 4, 2023
how about having it as
__safe_indexing__? With the right disclaimers about potential changes re:API.glemaitre commentedon Dec 4, 2023
I don't recall that we broke the backward compatibility. However, we added new features over the years.
ENH Make _safe_indexing a public API function by renaming to safe_ind…
lorentzenchr commentedon Nov 17, 2025
+0 (can live either way)
A few thoughts: Maybe the fact that we internally use it very often is an indication that should not make it public. Indexing does not seem to be something that scikit-learn should fix, IMO. On the other side, many projects seem to import it even if it's not public.
The difficult part about it is the mix between Array API and Dataframes. The latter alone can be done with narwhals.
lorentzenchr commentedon Nov 17, 2025
For the time being, I think we should remove it from the public API, #32728. We can add it again when we conclude to make it public again.