Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: value_counts Int64 zero-size array to reduction #33317

Closed
3 tasks done
mgsnuno opened this issue Apr 6, 2020 · 3 comments · Fixed by #33339
Closed
3 tasks done

BUG: value_counts Int64 zero-size array to reduction #33317

mgsnuno opened this issue Apr 6, 2020 · 3 comments · Fixed by #33339
Labels
Bug NA - MaskedArrays Related to pd.NA and nullable extension arrays
Milestone

Comments

@mgsnuno
Copy link

mgsnuno commented Apr 6, 2020

  • 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.


pd.Series([], dtype='int64').value_counts()  # Series([], dtype: int64)
pd.Series([], dtype='Int64').value_counts()  # ValueError: zero-size array to reduction ...

Problem description

Found this while using Int64 types in dask. Error occurred in _meta.value_counts()

Expected Output

Error not to occur.

Output of pd.show_versions()

INSTALLED VERSIONS

commit : None
python : 3.7.6.final.0
python-bits : 64
OS : Linux
OS-release : 4.19.113-1-MANJARO
machine : x86_64
processor :
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8

pandas : 1.0.3
numpy : 1.18.2
pytz : 2019.3
dateutil : 2.8.1
pip : 20.0.2
setuptools : 46.1.3.post20200325
Cython : None
pytest : 5.4.1
hypothesis : None
sphinx : None
blosc : 1.9.0
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.11.1
IPython : 7.13.0
pandas_datareader: None
bs4 : 4.9.0
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : None
matplotlib : 3.2.1
numexpr : None
odfpy : None
openpyxl : 3.0.3
pandas_gbq : None
pyarrow : 0.16.0
pytables : None
pytest : 5.4.1
pyxlsb : None
s3fs : 0.4.2
scipy : 1.4.1
sqlalchemy : 1.3.15
tables : None
tabulate : None
xarray : 0.15.1
xlrd : 1.2.0
xlwt : None
xlsxwriter : None
numba : 0.48.0

@mgsnuno mgsnuno added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Apr 6, 2020
@simonjayhawkins
Copy link
Member

Thanks @mgsnuno for the report. This issue didn't exist in 0.25.3 so marking as regression.

>>> import pandas as pd
>>>
>>> pd.__version__
'0.25.3'
>>>
>>> pd.Series([], dtype="int64").value_counts()
Series([], dtype: int64)
>>>
>>> pd.Series([], dtype="Int64").value_counts()
Series([], dtype: int64)
>>>

@simonjayhawkins simonjayhawkins added NA - MaskedArrays Related to pd.NA and nullable extension arrays Regression Functionality that used to work in a prior pandas version and removed Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Apr 6, 2020
@simonjayhawkins
Copy link
Member

This issue didn't exist in 0.25.3 so marking as regression.

raises from #30824 (i.e. 1.0.0)

8bdd7b1 is the first bad commit
commit 8bdd7b1
Author: Tom Augspurger TomAugspurger@users.noreply.github.com
Date: Thu Jan 9 13:19:34 2020 -0600

BUG: BooleanArray.value_counts dropna (#30824)

cc @TomAugspurger

@jreback
Copy link
Contributor

jreback commented Apr 6, 2020

@simonjayhawkins generally we don't mark experimental features as regressions, simply mark them as bugs.

@simonjayhawkins simonjayhawkins added Bug and removed Regression Functionality that used to work in a prior pandas version labels Apr 6, 2020
@jreback jreback added this to the 1.1 milestone Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug NA - MaskedArrays Related to pd.NA and nullable extension arrays
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants