We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
as commented #1050 (comment) ,
we're gonna block generating SeriesGroupby by its column name to follow the behavior of pandas.
SeriesGroupby
>>> import pandas as pd >>> pser = pd.Series([1, 2, 3, 4, 5], name='x') >>> pser.groupby(pser.name).head(2) Traceback (most recent call last): ... KeyError: 'x'
i think it's better to fix this in separated PR with a separated Issue to make it more clarify and add related tests for existing functions.
+
and also by should not allowed as type of DataFrame like below.
by
DataFrame
>>> pdf = pd.DataFrame({'a': [1, 2, 6, 4, 4, 6, 4, 3, 7], ... 'b': [4, 2, 7, 3, 3, 1, 1, 1, 2], ... 'c': [4, 2, 7, 3, None, 1, 1, 1, 2], ... 'd': list('abcdefght')}, ... index=[0, 1, 3, 5, 6, 8, 9, 9, 9]) >>> pdf.groupby(pdf) Traceback (most recent call last): ... ValueError: Grouper for '<class 'pandas.core.frame.DataFrame'>' not 1-dimensional >>> pdf.a.groupby(pdf) Traceback (most recent call last): ... ValueError: Grouper for '<class 'pandas.core.frame.DataFrame'>' not 1-dimensional
The text was updated successfully, but these errors were encountered:
I'm working on this.
Sorry, something went wrong.
disable 'str' for 'SeriesGroupBy', disable 'DataFrame' for 'GroupBy' (#…
00d824a
…1097) Resolve #1095 ```python >>> kser = ks.Series([1, 2, 3, 4, 5], name='x') >>> kser.groupby('x').head(2) Traceback (most recent call last): ... KeyError: ('x',) ``` ```python >>> pdf = pd.DataFrame({'a': [1, 2, 6, 4, 4, 6, 4, 3, 7], ... 'b': [4, 2, 7, 3, 3, 1, 1, 1, 2], ... 'c': [4, 2, 7, 3, None, 1, 1, 1, 2], ... 'd': list('abcdefght')}, ... index=[0, 1, 3, 5, 6, 8, 9, 9, 9]) >>> pdf.groupby(pdf) Traceback (most recent call last): ... ValueError: Grouper for '<class 'pandas.core.frame.DataFrame'>' not 1-dimensional >>> pdf.a.groupby(pdf) Traceback (most recent call last): ... ValueError: Grouper for '<class 'pandas.core.frame.DataFrame'>' not 1-dimensional ```
Successfully merging a pull request may close this issue.
as commented #1050 (comment) ,
we're gonna block generating
SeriesGroupby
by its column name to follow the behavior of pandas.i think it's better to fix this in separated PR with a separated Issue to make it more clarify and add related tests for existing functions.
+
and also
by
should not allowed as type ofDataFrame
like below.The text was updated successfully, but these errors were encountered: