Skip to content

Issue Regularizing a awkward Array of Strings #2465

Discussion options

You must be logged in to vote

However, you are correct that this is an issue with my older version of awkward! Hooray 🎉 I will upgrade.

Python 3.10.6 (main, Mar 10 2023, 10:55:28) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import awkward as ak
>>> ak.__version__
'2.2.1'
>>> a = ak.Array({
...     'keep' : [
...         [True],
...         [False, True, True],
...         [],
...         [True, False]
...     ],
...     'mystr' : [
...         ['yes'],
...         ['foo','blabla','hellothere'],
...         [],
...         ['generalkenobi','anakin']
...     ]
... })
>>> ak.to_numpy(ak.flatten(a['mystr'][a['keep']]))
array(['yes', 'blabla', 'hellothere', 'generalkenobi'

Replies: 4 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@agoose77
Comment options

@tomeichlersmith
Comment options

@agoose77
Comment options

@tomeichlersmith
Comment options

Comment options

You must be logged in to vote
2 replies
@tomeichlersmith
Comment options

@jpivarski
Comment options

Answer selected by tomeichlersmith
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants