Skip to content

Conversation

@rsm-23
Copy link
Contributor

@rsm-23 rsm-23 commented Jul 2, 2023

@rsm-23
Copy link
Contributor Author

rsm-23 commented Jul 4, 2023

@MarcoGorelli please review this when possible.

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 your PR

sorry, I didn't explain the issue very clearly

the original issue was about Series.corr, so let's add an example there instead

How about an example in which we show:

>>> s1 = pd.Series([1, 2, 3], index=[0, 1, 2])
>>> s2 = pd.Series([1, 2, 3], index=[2, 1, 0])

and note that s1.corr(s2) gives -1.0 because pandas aligns the indexes?

@MarcoGorelli MarcoGorelli added this to the 2.1 milestone Jul 5, 2023
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.

wonderful, thanks @rsm-23 !

let's close the issue with this one, if other places come up where results are unexpected we can document more clearly there too, otherwise the issue will stay open forever

@MarcoGorelli
Copy link
Member

/preview

@github-actions
Copy link
Contributor

github-actions bot commented Jul 5, 2023

Website preview of this PR available at: https://pandas.pydata.org/preview/53972/

@MarcoGorelli
Copy link
Member

just waiting for the preview to load, then I'll check that the rendered docs look alright, then hopefully we can merge

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.

the changes look good, but it's failing the doc build

/home/runner/work/pandas/pandas/pandas/core/groupby/generic.py:docstring of pandas.core.groupby.generic.SeriesGroupBy.corr:33: ERROR: Content block expected for the "note" directive; none found.
/home/runner/work/pandas/pandas/pandas/core/groupby/generic.py:docstring of pandas.core.groupby.generic.SeriesGroupBy.corr:34: WARNING: Explicit markup ends without a blank line; unexpected unindent.
/home/runner/work/pandas/pandas/pandas/core/series.py:docstring of pandas.core.series.Series.corr:33: ERROR: Content block expected for the "note" directive; none found.
/home/runner/work/pandas/pandas/pandas/core/series.py:docstring of pandas.core.series.Series.corr:34: WARNING: Explicit markup ends without a blank line; unexpected unindent.

could you build this page locally please and make sure it passes? then it should be good

cd doc
python make.py --single pandas.Series.corr

@rsm-23
Copy link
Contributor Author

rsm-23 commented Jul 5, 2023

Sure @MarcoGorelli

@rsm-23
Copy link
Contributor Author

rsm-23 commented Jul 5, 2023

I tried building this page using
python make.py --single pandas.Series.corr
But that doesn't seem to build this page. Can you please guide me on what I am missing? @MarcoGorelli

@MarcoGorelli
Copy link
Member

don't know, can you check the contributing guide for documentation please?

@rsm-23
Copy link
Contributor Author

rsm-23 commented Jul 5, 2023

@MarcoGorelli can you please check the docs?

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 @rsm-23 !

@MarcoGorelli MarcoGorelli merged commit 7856c02 into pandas-dev:main Jul 5, 2023
rsm-23 added a commit to rsm-23/pandas that referenced this pull request Jul 5, 2023
* Added note for corr

* Removed additional linebreak

* Added example and note for Series.corr

* Update frame.py

* Added operation in example

* Fixed indentation error for note

* Relocated notes
Daquisu pushed a commit to Daquisu/pandas that referenced this pull request Jul 8, 2023
* Added note for corr

* Removed additional linebreak

* Added example and note for Series.corr

* Update frame.py

* Added operation in example

* Fixed indentation error for note

* Relocated notes
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.

DOC: better explain the automatic alignment process

2 participants