Skip to content

DOC: Typo(s?) in pandas.DataFrame.isin #43755

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
1 task done
loucadufault opened this issue Sep 26, 2021 · 10 comments · Fixed by #43820
Closed
1 task done

DOC: Typo(s?) in pandas.DataFrame.isin #43755

loucadufault opened this issue Sep 26, 2021 · 10 comments · Fixed by #43820
Assignees
Labels
Milestone

Comments

@loucadufault
Copy link

  • I have checked that the issue still exists on the latest versions of the docs on master here

Location of the documentation

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.isin.html

Documentation problem

In the last example, the text introducing the code snippet reads:

When values is a Series or DataFrame the index and column must match. Note that ‘falcon’ does not match based on the number of legs in df2.

However, "df2" does not exist in the included code snippet (it is instead called "other").

Additionally, I am not comfortable enough with pandas to assert this, but it seems like the text should incorrectly states that "falcon" does not match, since "falcon" indeed does match for both columns, see the relevant portion of the code snippet:

>>> df.isin(other)
        num_legs  num_wings
falcon      True       True
dog        False      False

Suggested fix for documentation

Text should at least read:

When values is a Series or DataFrame the index and column must match. Note that ‘falcon’ does not match based on the number of legs in other.

or the variable in the code snippet should be renamed to "df2".

Additionally, something may need to be done to address the potential discrepancy in saying that "falcon" does not match.

@loucadufault loucadufault added Docs Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 26, 2021
@attack68 attack68 added this to the Contributions Welcome milestone Sep 26, 2021
@Varun270
Copy link
Contributor

@loucadufault I am not able to find out the exact location of the file that needs to be fixed. Can you tell me what is the location of this file? I tried finding it through this link https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.isin.html but wasn't able to spot the relevant folders.

@johnzangwill
Copy link
Contributor

johnzangwill commented Sep 27, 2021

@Varun270 The file is frame.py. If you want to fix it I'll leave it to you. Otherwise, I can.

@MarcoGorelli
Copy link
Member

@loucadufault I am not able to find out the exact location of the file that needs to be fixed. Can you tell me what is the location of this file? I tried finding it through this link https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.isin.html but wasn't able to spot the relevant folders.

You can find locations clicking on 'source':
Screenshot 2021-09-27 at 09 55 06

@Varun270
Copy link
Contributor

@Varun270 The file is frame.py. If you want to fix it I'll leave it to you. Otherwise, I can.

Yeah, I would love to fix this issue. Thanks !!!

@Varun270
Copy link
Contributor

take

Varun270 added a commit to Varun270/pandas that referenced this issue Sep 28, 2021
@lithomas1 lithomas1 removed the Needs Triage Issue that has not been reviewed by a pandas team member label Sep 28, 2021
@Varun270
Copy link
Contributor

pandas_new_issue

@Varun270
Copy link
Contributor

pandas_new_issue_git

@Varun270
Copy link
Contributor

@MarcoGorelli I have pushed the changes but somehow instead of pushing it from Development ----> Master. I pushed it from Development ----> Development. Development is a branch that I made. what should I do now to fix this delete the previous commit and again create a PR?

@MarcoGorelli
Copy link
Member

you can make a new branch - I recommend the first 3 chapters of this book for getting familiar with the git workflow

@johnzangwill
Copy link
Contributor

@Varun270 Just follow the "contributing" instructions to the letter. Yes, there is a bit of a learning curve...

I suggest that you change your change slightly. You say "Note that 'falcon' does not match based on the number of legs in other."
But in fact it does match.

I would change to:

other = pd.DataFrame({'num_legs': [8, 3], 'num_wings': [0, 2]},index=['spider', 'falcon'])

Then you will indeed get the falcon not matching:

 >>> df.isin(other)
                num_legs  num_wings
        falcon     False       True
        dog        False      False

Varun270 added a commit to Varun270/pandas that referenced this issue Sep 30, 2021
@jreback jreback modified the milestones: Contributions Welcome, 1.4 Sep 30, 2021
Varun270 added a commit to Varun270/pandas that referenced this issue Oct 2, 2021
jreback pushed a commit that referenced this issue Oct 3, 2021
gasparitiago pushed a commit to gasparitiago/pandas that referenced this issue Oct 9, 2021
Varun270 added a commit to Varun270/pandas that referenced this issue Nov 15, 2021
MarcoGorelli pushed a commit that referenced this issue Nov 15, 2021
* fixed Issued No.#43755

* Added . on to check_dtype and obj parameter

* Revert "fixed Issued No.#43755"

This reverts commit 11f27df.
Varun270 added a commit to Varun270/pandas that referenced this issue Dec 3, 2021
Varun270 added a commit to Varun270/pandas that referenced this issue Dec 3, 2021
Varun270 added a commit to Varun270/pandas that referenced this issue Dec 3, 2021
Varun270 added a commit to Varun270/pandas that referenced this issue Dec 5, 2021
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 a pull request may close this issue.

7 participants