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

(DOC) A string passed to groupby is hard to understand based on current doc #16870

Closed
BranYang opened this issue Jul 10, 2017 · 6 comments · Fixed by #36238
Closed

(DOC) A string passed to groupby is hard to understand based on current doc #16870

BranYang opened this issue Jul 10, 2017 · 6 comments · Fixed by #36238

Comments

@BranYang
Copy link
Contributor

Code Sample, a copy-pastable example if possible

From Here

For DataFrame objects, a string indicating a column to be used to group. Of course 
df.groupby('A') is just syntactic sugar for df.groupby(df['A']), but 
it makes life simpler
For DataFrame objects, a string indicating an index level to be used to group.

Problem description

These two sentences are in a kind of conflict with each other, until one read until she read the note below.

Expected Output

Reword to make it clear that a string may indicate column or index level

Output of pd.show_versions()

INSTALLED VERSIONS ------------------ commit: None python: 3.5.3.final.0 python-bits: 64 OS: Darwin OS-release: 16.6.0 machine: x86_64 processor: i386 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8

pandas: 0.21.0.dev+193.gb2b5dc32e
pytest: 3.1.2
pip: 9.0.1
setuptools: 36.0.1
Cython: 0.25.2
numpy: 1.13.0
scipy: 0.19.0
xarray: None
IPython: 6.0.0
sphinx: 1.6.2
patsy: 0.4.1
dateutil: 2.6.0
pytz: 2017.2
blosc: None
bottleneck: 1.2.1
tables: None
numexpr: 2.6.2
feather: None
matplotlib: 2.0.2
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: 0.9999999
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.9.6
s3fs: None
pandas_gbq: None
pandas_datareader: None

@jreback
Copy link
Contributor

jreback commented Jul 10, 2017

doc improvements always welcome!

@DillonCh
Copy link

DillonCh commented Jun 7, 2018

For DataFrame objects, a string indicating either a column name or index level name to be used to group.

Note: df.groupby('A') is just syntactic sugar for df.groupby(df['A']), but it makes life simpler

@sanchiprakash
Copy link

is this still open? i would like to proceed with it.

@SaiSridhar783
Copy link

For DataFrame objects, a string indicating a column or a row can be used to group.

Of course df.groupby('A') is just syntactic sugar for df.groupby(df['A']), but it makes life simpler.

@Nikhil1O1
Copy link
Contributor

take

@Nikhil1O1
Copy link
Contributor

I submitted a pull request with the issue concerned above.
#36238 @jreback @BranYang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants