Pandas version checks
Reproducible Example
import pandas as pd
ser = pd.Series([0, 1, True, False])
>>> ser.factorize()[1]
Index([0, 1], dtype='object')
Issue Description
factorize on object dtype doesn't differentiate 0 from False or 1 from True.
This is half of the issue behind #21108.
Expected Behavior
I'd expect the uniques to include [True, False, 1, 0]
Installed Versions
Details
Replace this line with the output of pd.show_versions()
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
factorize on object dtype doesn't differentiate 0 from False or 1 from True.
This is half of the issue behind #21108.
Expected Behavior
I'd expect the uniques to include
[True, False, 1, 0]Installed Versions
Details
Replace this line with the output of pd.show_versions()