Skip to content

DOC: DataFrame.reindex improve summary and return type #34584

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

Conversation

gauravchandok
Copy link

@gauravchandok gauravchandok commented Jun 4, 2020

@pep8speaks
Copy link

pep8speaks commented Jun 6, 2020

Hello @gauravchandok! 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 2020-06-06 21:18:56 UTC

@fujiaxiang
Copy link
Member

fujiaxiang commented Jun 9, 2020

While I'm reading your changes I realized there is more to this confusion than just the docstring. See #34663. The behavior of copy is confusing in my opinion. We probably need to address that first.

At the moment, I don't think this PR explains its behavior accurately. Let's discuss in #34663 what the desired outcome should be, which could be to deprecate copy. After that you can continue working on this PR or open a new PR to achieve that.

@dsaxton
Copy link
Member

dsaxton commented Sep 16, 2020

@gauravchandok Can you merge master to fix conflicts?

is produced unless the new index is equivalent to the current one and
``copy=False``.
Places NA/NaN in locations having no value in the previous index. A new
DataFrame with an additional index is generated subject to customization
Copy link
Contributor

Choose a reason for hiding this comment

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

this is generic, so could be Series/DataFrame

@@ -4286,7 +4286,7 @@ def reindex(self: FrameOrSeries, *args, **kwargs) -> FrameOrSeries:

Returns
-------
%(klass)s with changed index.
%(klass)s with 2 indices.
Copy link
Contributor

Choose a reason for hiding this comment

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

this is not correct, only 1 index is changed.

@@ -4239,11 +4239,11 @@ def sort_values(

def reindex(self: FrameOrSeries, *args, **kwargs) -> FrameOrSeries:
"""
Conform %(klass)s to new index with optional filling logic.
Create an object with a new index and columns retained from %(klass)s.
Copy link
Contributor

Choose a reason for hiding this comment

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

this is not true, you can specify index and/or columns.

Places NA/NaN in locations having no value in the previous index. A new object
is produced unless the new index is equivalent to the current one and
``copy=False``.
The values are only retained for index that matches in %(klass)s else NA/Nan.
Copy link
Contributor

Choose a reason for hiding this comment

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

can you say what the intent is here?

@github-actions
Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Oct 21, 2020
@dsaxton
Copy link
Member

dsaxton commented Oct 21, 2020

@gauravchandok Can you address comments and merge master?

@arw2019
Copy link
Member

arw2019 commented Nov 4, 2020

Closing for now. @gauravchandok ping us whenever you'd like to continue and we'll reopen!

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