Choosing the default axis for fill_none
#920
agoose77
started this conversation in
Deprecations
Replies: 1 comment 6 replies
-
I don't think For me, I see the choice as being between @lgray, @nsmith-, and @raymondEhlers, you have all been involved in issues that mentioned |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Context
In #917 a new
axis
parameter is added to constrain the scope offill_none
to a particular layout depth. This should make the function more predictable.axis
may be set toNone
, in which casefill_none
will recurse to all axes.However, as this new behaviour is breaking, it must be opted into explicitly, i.e. with
ak.fill_none(array, axis=...)
. Once the deprecation period elapses, we will need to choose a default axis. For context, the current behaviour without an axis is to find the first option axis, starting from 0, and remove the option type.New behaviour
For an example of the new behaviour, consider the following layout:
This layout has the corresponding list representation:
If we call
fill_none
withaxis=0
, then it will try to remove anyNone
s in the zeroth axis:This array does not have any
None
s in the zeroth axis (because a bareRegularArray
produces sublists of fixed size), and so it returns the same layout.Now, if we call
fill_none
withaxis=1
, it will remove theNone
s in the first axis:This does change the layout, because of the
IndexedOptionArray64
that theRegularyArray
builds the sublists from.Finally, we have the
axis=None
behaviour. Clearly, all levels ofNone
have been removed.Default
axis
?So, the question remains, what should
ak.fill_none(layout, <value>)
do? There are some options:axis=0
for symmetry withak.is_none
axis=1
for symmetry withak.pad_none
(and some other existing functions)axis=-1
for "the most likely" scenario that users are filling with scalar valuesThis Discussion is a welcome place for users to provide their opinions on what the new defaults should be. As @jpivarski says, now is the time to decide it whilst it's not depended upon!
Beta Was this translation helpful? Give feedback.
All reactions