removing none from an awkward array

695 Views Asked by At

I have an awkward array (1) which I obtained post-processing.

An array look like:

>>> ak.Array([96., 99., 67., 13.,  3.,  None, 1.,  1.,None])

I want to remove the None elements from this array. I could remove them using loop, but I want to avoid it to save some computing time. Or writing a function and compiling using Numba is only option?

Thanks.

1

There are 1 best solutions below

0
On BEST ANSWER

I just realised that is_none exist and works like charm,

a[~ak.is_none(a)]