Skip to content

How to remove the question mark in type after apply "ak.pad_none" to a full-value array? #3046

Answered by agoose77
Star9daisy asked this question in Q&A
Discussion options

You must be logged in to vote

Having pad_none produce a different type according to the list-lengths of the array would introduce a data dependence on the operation result. That's not something we want to happen, as we rely on the lack of data dependence to be able to predict the result of Awkward operations ahead of time (used by https://github.com/dask-contrib/dask-awkward).

If you just want to drop the option type, because you know that the array does not contain any Nones, then you can use ak.drop_none(..., axis=-1). If you don't know whether your array will contain Nones then you need to use ak.fill_none, and choose the appropriate fill value.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@Star9daisy
Comment options

@agoose77
Comment options

@Star9daisy
Comment options

@agoose77
Comment options

@Star9daisy
Comment options

Answer selected by Star9daisy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants