BUG: DataFrame.mode index dtype is not type stable #33321
Labels
Algos
Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff
Bug
Dtype Conversions
Unexpected or buggy dtype conversions
Milestone
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
(optional) I have confirmed this bug exists on the master branch of pandas.
Code Sample, a copy-pastable example
The
.index.dtype
is not stable for DataFrame.mode. It depends on whether the DataFrame is empty and possible the dtypesProblem description
The index dtype should always be Int64, to match the non-empty case
Expected Output
The text was updated successfully, but these errors were encountered: