There are some cases were you do not want this. I have seen this several times but I am unsure whether or not it's more frequent than the need for the current behavior. I propose adding a fill_value argument, which would default to None (notnan), which would keep the current behavior of reducing the axis. However, if the fill_value argument is given a value (usually 0 or nan), the axis is kept intact, but the labels which would have been dropped with the current behavior are set to the fill_value instead.
Also supporting an array fill_value (eg, to specify the new "column", would feel natural and make some workflows easier.
Currently shift reduce the axis size.
There are some cases were you do not want this. I have seen this several times but I am unsure whether or not it's more frequent than the need for the current behavior. I propose adding a fill_value argument, which would default to
None
(notnan
), which would keep the current behavior of reducing the axis. However, if the fill_value argument is given a value (usually0
ornan
), the axis is kept intact, but the labels which would have been dropped with the current behavior are set to thefill_value
instead.Also supporting an array fill_value (eg, to specify the new "column", would feel natural and make some workflows easier.