Closed
Description
There are two ways we could avoid having to explicitly set the numpy dtypes of nullable data after a Series.to_numpy
call.
- Pandas stops converting nullable dtypes to
object
inSeries.to_numpy
call: API: should to_numpy() by default return the corresponding type, and raise otherwise? pandas-dev/pandas#48891 - then we could just callto_numpy
and not have to worry about setting the correct dtype - Sklearn supports the nullable dtypes in
unique_labels
(Support nullable pandas dtypes inunique_labels
scikit-learn/scikit-learn#25634) andsklearn_confusion_matrix
(Support nullable pandas dtypes inconfusion_matrix
scikit-learn/scikit-learn#25635) - currently neither do, which is why we handle the dtype changes prior to making those calls. Once support is added, we can stop converting the data to numpy arrays before passing in y true and predicted
If either of the above are completed and released, we can upgrade to that version and make any needed changes to remove nullable type handling from #4019.
Metadata
Metadata
Assignees
Labels
No labels