-
Notifications
You must be signed in to change notification settings - Fork 15
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
How to reverse the order of an array along one or several dimensions? #3447
Comments
Is import scipp as sc
da = sc.data.data_xy()
sc.sort(da, 'x', order='descending') |
No not really. I don't want the entries sorted, I just want them in revered order. |
What is the utility of adding a named function? As I see it, the only reason to have So I would stick with the (almost) standard Python syntax of We talked about collecting usage patterns at some point. This could be added there if we actually write them down. But can I ask you, why did this come up? |
Sure, but: sc.arange('x', 0, 10)['x', ::-1]
# IndexError: negative slice step support not implemented It came up when I translated some numpy code to scipp. |
Isn't it because we don't support negative strides? |
Supporting negative strides should be the way to go. Note #3188, which would probably make this much easier. |
What is the equivalent of
np.flip(...)
orarr[::-1]
in scipp?Maybe we should make this easier to find in the docs.
The text was updated successfully, but these errors were encountered: