-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: SeriesGroupBy.value_counts() throws IndexError if there is only one group #42618
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
Closed
2 of 3 tasks
Labels
Algos
Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff
Bug
Groupby
Regression
Functionality that used to work in a prior pandas version
Milestone
Comments
Correction: error occurs when there is only one row in the dataframe that the grouby is created from not when there is one group. |
take |
neelmraman
added a commit
to neelmraman/pandas
that referenced
this issue
Jul 20, 2021
neelmraman
added a commit
to neelmraman/pandas
that referenced
this issue
Jul 20, 2021
4 tasks
Thanks for the report! Verified on master. |
@rhshadrach mind also taking a look at the PR when you get the chance? thanks! |
simonjayhawkins
added a commit
to simonjayhawkins/pandas
that referenced
this issue
Jul 23, 2021
neelmraman
added a commit
to neelmraman/pandas
that referenced
this issue
Jul 24, 2021
rhshadrach
pushed a commit
that referenced
this issue
Jul 24, 2021
meeseeksmachine
pushed a commit
to meeseeksmachine/pandas
that referenced
this issue
Jul 24, 2021
…nts when DataFrame has one row (pandas-dev#42618)
simonjayhawkins
pushed a commit
that referenced
this issue
Jul 24, 2021
…ataFrame has one row (#42618) (#42696) Co-authored-by: neelmraman <[email protected]>
CGe0516
pushed a commit
to CGe0516/pandas
that referenced
this issue
Jul 29, 2021
feefladder
pushed a commit
to feefladder/pandas
that referenced
this issue
Sep 7, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Algos
Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff
Bug
Groupby
Regression
Functionality that used to work in a prior pandas version
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
Problem description
Calling
value_counts()
on aSeriesGroupBy
throws anIndexError
when there is only one group.Expected Output
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : f00ed8f
python : 3.9.4.final.0
python-bits : 64
OS : Darwin
OS-release : 19.6.0
Version : Darwin Kernel Version 19.6.0: Mon Apr 12 20:57:45 PDT 2021; root:xnu-6153.141.28.1~1/RELEASE_X86_64
machine : x86_64
processor : i386
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.3.0
numpy : 1.20.2
pytz : 2021.1
dateutil : 2.8.1
pip : 21.0.1
setuptools : 54.2.0
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : None
IPython : 7.23.0
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 4.0.0
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None
The text was updated successfully, but these errors were encountered: