Skip to content

DOC: added examples to align function's documentation #42129

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
wants to merge 2 commits into from

Conversation

meiruv
Copy link

@meiruv meiruv commented Jun 19, 2021

@pep8speaks
Copy link

pep8speaks commented Jun 19, 2021

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

Line 8547:1: W293 blank line contains whitespace

Comment last updated at 2021-07-13 11:54:34 UTC

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

This is off to a good start!

Some pre-commit checks are failing though, see here for how to run them

@@ -8514,10 +8514,31 @@ def align(
-------
(left, right) : ({klass}, type of other)
Aligned objects.
"""

method = missing.clean_fill_method(method)
Copy link
Member

Choose a reason for hiding this comment

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

this shouldn't be removed

Copy link
Author

Choose a reason for hiding this comment

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

I addressed this in the last commit

@simonjayhawkins simonjayhawkins changed the title added examples to align function's documentation DOC: added examples to align function's documentation Jun 25, 2021
@MarcoGorelli
Copy link
Member

Hey @meiruv - are you still working on this? No hurry, just checking if it's still active / if you need help with anything

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

Thanks for updating!

The example looks good, there's just a pre-commit failure, see here, can you fix it up please?

>>> df2 = pd.DataFrame([[10,20,30,40], [60,70,80,90], [600,700,800,900]],
columns=['A', 'B', 'C', 'D'], index=[2,3,4])

>>> a1, a2 = df1.align(df2, join='outer', axis=1)
Copy link
Member

Choose a reason for hiding this comment

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

perhaps call these left, right?

3 60 70 80 90 NaN
4 600 700 800 900 NaN

>>> a1, a2 = df1.align(df2, join='inner', axis=None)
Copy link
Member

Choose a reason for hiding this comment

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

likewise

Comment on lines +8523 to +8524
>>> df1 = pd.DataFrame([[1,2,3,4], [6,7,8,9]],
columns=['D', 'B', 'E', 'A'], index=[1,2])
Copy link
Member

Choose a reason for hiding this comment

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

also, the formatting's a bit strange here, it would be better to either format your example with black, or to align the arguments, like

Suggested change
>>> df1 = pd.DataFrame([[1,2,3,4], [6,7,8,9]],
columns=['D', 'B', 'E', 'A'], index=[1,2])
>>> df1 = pd.DataFrame(
... [[1,2,3,4], [6,7,8,9]],
... columns=['D', 'B', 'E', 'A'],
... index=[1, 2]
... )

(same for the other parts of the example)

@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 Aug 17, 2021
@MarcoGorelli
Copy link
Member

Hi @meiruv - still working on this? Looks like it's pretty close - no hurry if you are, would just be good to know

@MarcoGorelli
Copy link
Member

closing as per #42125 (comment)

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.

DOC add example to align
4 participants