Frame-level all_horizontal
/ any_horizontal
#20718
Labels
enhancement
New feature or an improvement of an existing feature
all_horizontal
/ any_horizontal
#20718
Description
I was recently looking at a question on stackoverflow concerned with checking if all values of a dataframe are
True
. While answering, I noticed that there are no frame-level methods to compute bitwise AND / OR horizontally across columns (pl.DataFrame.all_horizontal
/pl.DataFrame.any_horizontal
). This leads to the unpleasant side-effect that the most precise answer to the aforementioned question relies onpl.DataFrame.min_horizontal
as follows.In contrast, a more explicit answer using
pl.all_horizontal
is a bit clumsy as one cannot rely on frame-level methods.Apart from increased API consistency, adding
pl.DataFrame.all_horizontal
would enable the user to write the following code.Hence, I'd propose adding
pl.DataFrame.all_horizontal
andpl.DataFrame.any_horizontal
to polars' public API.Please let me know what you think. Once signed off, I'd be happy to take a shot at the implementation and open a PR. Thanks!
The text was updated successfully, but these errors were encountered: