-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: Expand View vs copy in the docs #4183
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
Comments
for lists row and columns this produces a view, same for iloc, ix:
as do these
|
you only really get in trouble with a
the key point is that the assignment should in one call |
Do you mean copy? I wonder if this also warrants a cookbook section (I guess mainly for the update thing). |
no...what I mean is that when you do a setter it sets the correct object, it doesn't matter if its a view/copy because you never see a returned object anyways.
|
wowza, so boolean indexing does work now provided you use that:
|
|
boolean indexing with
but you CAN (and should) use |
|
I thought you couldn't use loc with a mask ? Oh wait I see, you use boolean index/column. Am I missing something:
|
the columns are aligned to that
|
So to use with loc they should be column_mask and row_mask, if that makes sense. I remember now (about iloc and boolean indexing). Also creating link to #4192 |
yep (mask or labels are ok) |
this is pretty good now |
At the moment it's a common source of confusion as to what returns a view vs a copy. The docs are fairly light on this atm.
Need to expand this section with lots of example, and update with what now returns a view.
I've said before to @jreback I'd do this but tbh, am not fully confident on the ins and outs so perhaps we can post a few examples here to get started.
The text was updated successfully, but these errors were encountered: