-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
slicedim and mapslices arguments inconsistent #18326
Comments
Yes, lately when I've looked at I believe the function behaves the way it does currently to be more similar to functions like |
I think that it is In the
with the reverse
This change would make it hard to write generic code that works for different sized input arrays, which is the whole point of |
That's a good point.
Now I'm curious --- could you explain? I think it would be useful to have standard terminology for both kinds of dimension arguments. I suspect both cases come up. For example you might want to "select" (in an sql-like sense) certain dimensions to keep, and have all the other dimensions reduced, or specify which dimensions to reduce (as in the current |
Should we just call the correct version of |
Sure, |
Must these two agree? They do very different things. On the other hand, |
Perhaps the biggest problem here is that they both use the root For reference, the current
|
I think the unstable one is the right answer. I've argued elsewhere that we should support mapslices(f, A, (:, *, :)) where here |
Should we just close this? |
I'm still very tempted to deprecate
|
Do it! That sounds like a great deletion candidate. |
Then why not just leave it until we do have a replacement? |
Because the name is confusing. If we can come up with a better name, I'd happily rename it. |
It's similar to a select --- basically "select from A where dim #i equals n". |
|
In slicedim() you tell which dimension equals a value:
On the other hand in mapslices you tell where the dots (:) are, so:
mapslice(f, a, 1) # a[:, n]
Would pass columns to function f.
The text was updated successfully, but these errors were encountered: