Using boolean series as masks is very handy in pandas.
Was wondering, if and how one could generate two-dimensional boolean arrays as masks for e.g. the where() or mask() functions to assign values to a set of cells specified by the mask.
The idea is to have a data frame and a two-dimensional boolean array of the same dimensions as the data frame and to set all cells that are True in the boolean array to value X while leaving all other data cells in the data frame untouched.
This certainly could be accomplished with a bunch of for loops stepping through the data frame and boolean array in parallel, but that does not seem very efficient or elegant.
Any pointers to the appropriate function names or tutorials would be very much appreciated.