Skip to content

DOC: add pivot_table note to dropna doc #47808

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 6 commits into from
Aug 1, 2022
Merged

Conversation

Mehgarg
Copy link
Contributor

@Mehgarg Mehgarg commented Jul 21, 2022

@datapythonista
Copy link
Member

Thanks for the pull request @Mehgarg

The pandas documentation is generated automatically from markdown files and docstring (documentation in the code). We never edit the final html files directly.

I think the changes you want to implement should be done to this docstring instead: https://github.com/pandas-dev/pandas/blob/main/pandas/core/frame.py#L6427

Can you revert this html file you're creating and edit the docstring please? Let me know if you need help

@datapythonista datapythonista changed the title Bug 47447: add pivot_table note to dropna doc DOC: add pivot_table note to dropna doc Jul 21, 2022
@pep8speaks
Copy link

pep8speaks commented Jul 21, 2022

Hello @Mehgarg! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2022-07-29 14:53:38 UTC

@@ -6455,7 +6455,7 @@ def dropna(
subset : column label or sequence of labels, optional
Labels along other axis to consider, e.g. if you are dropping rows
these would be a list of columns to include.
inplace : bool, default False
inplace : bool, default False
Copy link
Member

Choose a reason for hiding this comment

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

Can you revert this?

Notes
--------
Setting dropna to true will elimate rows containing any missing data
from the pivot_table.
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't seem to make a lot of sense. This method has nothing to do with pivot_table, and dropna is not a parameter, can't be set to anything. Maybe you may want to close this PR, try to understand better what you want to do, and start again?

@@ -0,0 +1,415 @@

Copy link
Member

Choose a reason for hiding this comment

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

You should revert the changes to this whole file (delete it).

@Mehgarg
Copy link
Contributor Author

Mehgarg commented Jul 26, 2022

Is the failed check expected behavior or do I need to fix something?

@@ -10045,7 +10047,7 @@ def merge(
suffixes: Suffixes = ("_x", "_y"),
copy: bool = True,
indicator: bool = False,
validate: str | None = None,
validate: str | None = None,
Copy link
Member

Choose a reason for hiding this comment

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

Can you please revert this?

Copy link
Member

Choose a reason for hiding this comment

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

This is pending and making the CI red

Copy link
Contributor Author

Choose a reason for hiding this comment

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

reverted

@@ -8564,7 +8564,9 @@ def pivot(self, index=None, columns=None, values=None) -> DataFrame:
margins : bool, default False
Add all row / columns (e.g. for subtotal / grand totals).
dropna : bool, default True
Do not include columns whose entries are all NaN.
Do not include columns whose entries are all NaN. If true:
Copy link
Member

Choose a reason for hiding this comment

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

True refers to Python True value, we usually use it with capital T. Also, please avoid the colon, as it's inconsistent with the rest of the docs, and personally I think make things harder to read in this case.

Other than those small formatting things, I think your description is clear now, thanks for thr update.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

made the changes, thanks for the help.

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

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

lgtm, thanks @Mehgarg

@mroeschke mroeschke added this to the 1.5 milestone Aug 1, 2022
@mroeschke mroeschke merged commit 3889d85 into pandas-dev:main Aug 1, 2022
@mroeschke
Copy link
Member

Thanks @Mehgarg

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

Successfully merging this pull request may close these issues.

BUG: pd.pivot_table margins don't include rows, which have a NaN within any column, for all columns
4 participants