-
Notifications
You must be signed in to change notification settings - Fork 54
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
Docs for hi/lo are confusing #24
Comments
Also, I think lo() is inclusive and hi() is exclusive in the indices, which is common but should be mentioned. |
Unless you're talking about something different, they both just clip the array. So note in particular that
is NOT the same as
They operate on the previous command's result, the first:
For the second:
So in other words, the don't commute. The docs specify "Note: hi and lo do not commute. In general: Is there additional wording or explanation you think would help prevent confusion? |
I just think the doc description for Let's start with lo:
First thing that confuses me is the word "shift". Shifting for me means that something changes but not the size of it, which would be wrong here. Now
Here it says that it is a different operation basically, not shifting but truncating, and making the array smaller, which however is the case for both The way I could make sense of it was to just try it out and figure out how it maps to numpy slicing syntax: |
Haha, yeah, maybe the answer is to word it in terms of more common operators:
I added a couple resources links right at the top of ndarray. The goal of this document was to clarify some of this, but I think it's too buried and frankly not good enough. The numpy version was a great resource when I was figuring out numpy. Oh man, I have a lot of cleanup work to do.... I'll see if I can clean up the lo/hi docs and run it by you. |
I love this: a.lo(2,3) => a[2:, 3:]
a.hi(8,7) => a[:8, :7] Because when I first see |
I wonder “lo” and “hi” are short for what? |
Hmm... I begin to forget what I learned before after a year... I can't agree more that lo/hi are really confusing... |
Yes, I just came here trying to understand it - and in fact in the beginning I was cursing that This does the dual of array.lo(). Instead of shifting from the top-left, it truncates from the bottom-right of the array, returning a smaller array object. should be This does the dual of array.lo(). Instead of shifting from the top-left, it truncates from the bottom-right of the array, returning a smaller array object of |
On the README, I understand the description for hi/lo as:
lo() is just a start offset for each dimension. hi() is the opposite, that is, it truncates by the amount for each dimension. But in fact, hi() is also based on absolute indices and not by an amount. So, I think this should be changed also examples with output added.
The text was updated successfully, but these errors were encountered: