scikit-hep / awkward

Manipulate JSON-like data with NumPy-like idioms.
https://awkward-array.org
BSD 3-Clause "New" or "Revised" License
806 stars 81 forks source link

fix: unexpected behaviour of akwhere with arrays containing nones #3168

Open tcawlfield opened 5 days ago

tcawlfield commented 5 days ago

There is a problem with ak.which (the three-argument version) where if both (1) a conditional array element is optional yet True/False, and (2) the array element NOT selected by the condition is optional and None, the resulting element will be None regardless of the value that ought to have been selected.