Skip to content

DOC: indexing with alignment #15508

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 1 commit into from

Conversation

mikeliu8492
Copy link

Per request of issue #13950, added documentation clarifying alignment of DataFrame Objects and assignment of subset of one DataFrame to subset indices of another Dataframe.

Main issue was that if indices did not match, behavior of Dataframe would render rows of non-matched indices as NaN. This could be corrected by assigning a non-Dataframe object of same appropriate dimension and value configuration to the proper Dataframe indices.

  • closes #xxxx
  • tests added / passed
  • passes git diff upstream/master | flake8 --diff
  • whatsnew entry

@jorisvandenbossche
Copy link
Member

@mikeliu8492 Thanks for the contribution.
You put your new examples in the docstring of the merge method, which is a strange place to put this. We could put this maybe somewhere http://pandas-docs.github.io/pandas-docs-travis/indexing.html#basics. There is already a note about alignment (example where the two columns are switched in order). We could eg make that note into a full section and add your example there.

@cpcloud cpcloud added this to the 0.20.0 milestone Feb 26, 2017
@cpcloud cpcloud self-assigned this Feb 26, 2017
@jreback
Copy link
Contributor

jreback commented Feb 27, 2017

@mikeliu8492 can you move this into the docs proper. a separate sub-section here: http://pandas.pydata.org/pandas-docs/stable/indexing.html (maybe call it Alignment), with a back-reference to: http://pandas.pydata.org/pandas-docs/stable/basics.html#aligning-objects-with-each-other-with-align

Once that is good I wouldn't be averse to putting a link to the docs in the doc-strings of the indexers (.iloc/.loc etc), where you have it now is in the merge-docs which doesn't make sense. (I see @jorisvandenbossche already said this!)

Also a concise version for the .iloc/.loc would be ok too (around https://github.com/pandas-dev/pandas/blob/master/pandas/core/indexing.py#L1569)

@jreback jreback added the Indexing Related to indexing on series/frames, not to indexes themselves label Feb 27, 2017
@jreback jreback changed the title added clarification on df alignment for issue 13950 DOC: indexing with alignment Feb 27, 2017
@jreback jreback removed this from the 0.20.0 milestone Mar 23, 2017
@jreback
Copy link
Contributor

jreback commented Apr 3, 2017

can you update

@mikeliu8492
Copy link
Author

mikeliu8492 commented Apr 3, 2017 via email

@jreback
Copy link
Contributor

jreback commented May 7, 2017

@mikeliu8492 can you update according to comments.

@mikeliu8492
Copy link
Author

mikeliu8492 commented May 7, 2017 via email

@jreback
Copy link
Contributor

jreback commented Aug 1, 2017

closing as stale. if you want to re-visit, pls comment and we can re-open.

@jreback jreback closed this Aug 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants