Skip to content

DOC: Update indexing implementation explanations. #4331

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

seberg
Copy link
Member

@seberg seberg commented Feb 20, 2014

I am aware that the old stuff is a bit more in depth. But it is now hopelessly outdated, so I tried to give at least an overview of how things work now. I don't know if this actually gives an idea of what is going on, I wouldn't notice ;)...

@seberg
Copy link
Member Author

seberg commented Feb 20, 2014

On the up side, the code is now better documented I think, so I hope that it is actually readable on its own and includes more details.

* integer arrays/array-likes (fancy)
* boolean (single boolean array); if there is more then one boolean array as
index or the shape does not match exactly, the boolean array will be
converted to integer arrays instead.
Copy link
Member

Choose a reason for hiding this comment

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

Sounds dangerous/

Copy link
Member Author

Choose a reason for hiding this comment

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

It is ;), I would be +1 on deprecating it. May not be quite straight forward, but shouldn't be too hard either. Or do you mean because I forgot to mention the nonzero logic?

Copy link
Member

Choose a reason for hiding this comment

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

I'd be +1 too. As is, one may never be sure if a boolean is a boolean, or an integer posing as a boolean.

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if I was confusing now or not :). It always acts as a boolean, but the path to get there is through np.nonzero logic. The bad thing about it, is that a boolean array which is too small, will just be filled up with False.

@charris
Copy link
Member

charris commented Feb 22, 2014

I think the documentation would be helped enormously by a lot of examples with an explanation of how they are interpreted.

@mhvk
Copy link
Contributor

mhvk commented Jan 19, 2015

@seberg - I noticed this PR as the adding of the label made it float to the top. I think it is very useful, but note that in the ufuc section __numpy_ufunc__ should now be mentioned, not just the logic based on __array_priority__. Though that does pose the problem that its behaviour is still not completely solidified; see #4815...

@seberg
Copy link
Member Author

seberg commented Jan 19, 2015

Yeah, should get back to this some time... though I don't understand what this has to do with numpy ufunc...

@mhvk
Copy link
Contributor

mhvk commented Jan 19, 2015

I just read the whole section and noticed that https://github.com/numpy/numpy/pull/4331/files#diff-c4ce797b66d44da00848ce950e286105R350 did not mention __numpy_ufunc__, though the C code does make decisions based on its presence. But on reflection, I see that you had not touched the part on ufuncs at all here, so indeed it is not quite relevant. Sorry.

* slice
* ellipsis
* integer arrays/array-likes (fancy)
* boolean (single boolean array); if there is more then one boolean array as
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: "then" -> "than"

@charris
Copy link
Member

charris commented Apr 7, 2015

@seberg Do you have any time to work on this for 1.10?

@charris charris added this to the 1.10.0 release milestone Apr 7, 2015
@seberg
Copy link
Member Author

seberg commented Apr 7, 2015

Not really, but it is probably important enough anyway ;).

@charris
Copy link
Member

charris commented Apr 23, 2015

I did some basic fixes in #5791, so closing this. @seberg Could you take a look and see if anything more need clarification?

@charris charris closed this Apr 23, 2015
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.

4 participants