index method seems to always return zero when the element used is an awkward1 Array
See original GitHub issueI have been trying to use the index method, but it seems to always return 0.
Here is how I proceed:
import awkward1 as ak1
test = ak1.Array([[[1, 2, 3], [1, 2, 3], [1]],
[[0], [1, 2, 3]],
[[0], [1, 2, 3], [0], [1, 2, 3], [1, 2, 3]]])
print(test[1].index(ak1.Array([1, 2, 3])))
# 0
print(test[2].index(ak1.Array([1, 2, 3])))
# 0
any ideas why this is happening?
Thank you.
ping @tamasgal
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
ak.Array — Awkward Array 2.0.0 documentation
An integer selects one element. Like Python/NumPy, it is zero-indexed: 0 is the first item, 1 is the second, etc. Negative indexes count...
Read more >Unintuitive slicing behaviour when slicing with Arrays #370
Slicing by an array of indices would be very handy but currently fails (or is unreliable). Minimal working example taken (mostly based on ......
Read more >Error when using an awkward array with an index array
It's a generic iterable, and the constructor falls back to ak.from_iter. On your main question, the reason that arr doesn't slice values is ......
Read more >ak.behavior — Awkward Array 2.0.0 documentation
The approach taken by the Awkward Array library is to encode very little interpretation into the data themselves and apply an interpretation as...
Read more >4. Pointers and Arrays - Understanding and Using C ... - O'Reilly
A one-dimensional array is a linear structure. It uses a single index to access its members. The following is a declaration of a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Yep, the catch is really that the truthiness of an array is not an
all(...).@zinebaly I’d recommend to implement a numba JITted function, that should be fairly straight forward.
Yep, the catch is really that the truthiness of an array is not an
all(...).@zinebaly I’d recommend to implement a numba JITted function, that should be fairly straight forward.