DOC: indexing with alignment
State: closed

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


Labels:
name: Docs
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves

Comments:
@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.
@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)
can you update
Dear Jeff,

Thanks for reminding me.  I'm actually in University, and I am swamped this
week with a project and a midterm due early next week.  I'll try to see if
I could take care of it after next Monday though.  Thanks.


Mike

On Mon, Apr 3, 2017 at 10:16 AM, Jeff Reback <notifications@github.com>
wrote:

> can you update
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/pull/15508#issuecomment-291174570>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ANn2ss5ocXpoIGnnmUfJdaH1JoLHOg1Eks5rsQ1EgaJpZM4MMJSY>
> .
>

@mikeliu8492 can you update according to comments.
Dear Jeff,

It is finals week for me this time around.  I'll have to reconfigure my
development to update the push later on.  Thanks for reminding me.

Sincerely,


Mike Liu

On Sun, May 7, 2017 at 8:09 AM, Jeff Reback <notifications@github.com>
wrote:

> @mikeliu8492 <https://github.com/mikeliu8492> can you update according to
> comments.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/pull/15508#issuecomment-299708703>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ANn2sgsbOqL5w2hBvXrJD-puj8Bi1fW1ks5r3dCdgaJpZM4MMJSY>
> .
>

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