awkward-array

removing none from an awkward array


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.


Solution

  • I just realised that is_none exist and works like charm,

    a[~ak.is_none(a)]