Skip to content

DOC: Unsuppress relevant dataframe in split-apply-combine guide #42340

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

Merged
merged 2 commits into from
Jul 15, 2021
Merged

DOC: Unsuppress relevant dataframe in split-apply-combine guide #42340

merged 2 commits into from
Jul 15, 2021

Conversation

chrisyeh96
Copy link
Contributor

Currently, the user guide for groupby shows the following code, but it is unclear where the "C" and "D" columns come from.

image

In the rendered documentation, the preceding definition of df does not have "C" and "D" columns.

In [50]: arrays = [
   ....:     ["bar", "bar", "baz", "baz", "foo", "foo", "qux", "qux"],
   ....:     ["one", "two", "one", "two", "one", "two", "one", "two"],
   ....: ]
   ....: 

In [51]: index = pd.MultiIndex.from_arrays(arrays, names=["first", "second"])

In [52]: df = pd.DataFrame({"A": [1, 1, 1, 1, 2, 2, 3, 3], "B": np.arange(8)}, index=index)

In [53]: df
Out[53]: 
              A  B
first second      
bar   one     1  0
      two     1  1
baz   one     1  2
      two     1  3
foo   one     2  4
      two     2  5
qux   one     3  6
      two     3  7

Instead, the code under the heading "DataFrame column selection in GroupBy" is referring to a completely different dataframe which is in the RST file but is suppressed in the rendered documentation.

This pull request un-suppresses that relevant dataframe so that readers can see where the "C" and "D" columns come from.

@chrisyeh96 chrisyeh96 changed the title DOC: Unsuppress relevant dataframe in split-apply-combine doc DOC: Unsuppress relevant dataframe in split-apply-combine guide Jul 2, 2021
@mroeschke mroeschke added this to the 1.4 milestone Jul 11, 2021
Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. LGTM

Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@rhshadrach rhshadrach merged commit 013de03 into pandas-dev:master Jul 15, 2021
@rhshadrach
Copy link
Member

Thanks @chrisyeh96!

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

Successfully merging this pull request may close these issues.

4 participants