Skip to content
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

Strange and inconsistent ordering behavior with ak.sum #1371

Closed
masonproffitt opened this issue Mar 16, 2022 · 1 comment · Fixed by #1378
Closed

Strange and inconsistent ordering behavior with ak.sum #1371

masonproffitt opened this issue Mar 16, 2022 · 1 comment · Fixed by #1378
Labels
bug The problem described is something that must be fixed

Comments

@masonproffitt
Copy link

Version of Awkward Array

1.8.0

Description and code to reproduce

I basically expect ak.sum with axis=0 to add all rows together. So behavior like this makes sense:

>>> ak.sum([[[], [1]],
...         [[], [3]]], axis=0)
<Array [[], [4]] type='2 * var * int64'>

Just appending one element to each of the non-empty lists in the above example somehow changes ordering in the output:

>>> ak.sum([[[], [1, 2]],
...         [[], [3, 4]]], axis=0)
<Array [[4, 6], []] type='2 * var * int64'>

I of course expected to get [[], [4, 6]], so I'm not sure what's going on here.

@masonproffitt masonproffitt added the bug (unverified) The problem described would be a bug, but needs to be triaged label Mar 16, 2022
@agoose77
Copy link
Collaborator

I can confirm this in both v2 and v1, and I can't find a particular commit that introduces it within 1.5 → HEAD

@agoose77 agoose77 added bug The problem described is something that must be fixed and removed bug (unverified) The problem described would be a bug, but needs to be triaged labels Mar 16, 2022
@jpivarski jpivarski linked a pull request Mar 22, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The problem described is something that must be fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants