Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more
[X] I have checked that this issue has not already been reported.
[X] 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
import pandas as pd
series = pd.Series([1, 1, 2, 3]).astype('Int64')
print(series.mode(dropna=False))
Issue Description
This code causes the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/REDACTED/lib/python3.12/site-packages/pandas/core/series.py", line 2333, in mode
res_values = values._mode(dropna=dropna)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/REDACTED/lib/python3.12/site-packages/pandas/core/arrays/masked.py", line 1112, in _mode
result, res_mask = mode(self._data, dropna=dropna, mask=self._mask)
^^^^^^^^^^^^^^^^
ValueError: too many values to unpack (expected 2)
Expected Behavior
The code should print the modes of the input series.
Pandas version checks
[X] I have checked that this issue has not already been reported.
[X] 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
This code causes the following error:
Expected Behavior
The code should print the modes of the input series.
Installed Versions