Return an object of same shape as self and whose corresponding
entries are from self where cond is False and otherwise are from
other.

Parameters:

cond : boolean NDFrame, array-like, or callable

Where cond is False, keep the original value. Where
True, replace with corresponding value from other.
If cond is callable, it is computed on the NDFrame and
should return boolean NDFrame or array. The callable must
not change input NDFrame (though pandas doesn’t check it).

New in version 0.18.1: A callable can be used as cond.

other : scalar, NDFrame, or callable

Entries where cond is True are replaced with
corresponding value from other.
If other is callable, it is computed on the NDFrame and
should return scalar or NDFrame. The callable must not
change input NDFrame (though pandas doesn’t check it).

New in version 0.18.1: A callable can be used as other.

inplace : boolean, default False

Whether to perform the operation in place on the data

axis : alignment axis if needed, default None

level : alignment level if needed, default None

errors : str, {‘raise’, ‘ignore’}, default ‘raise’

raise : allow exceptions to be raised

ignore : suppress exceptions. On error return original object

Note that currently this parameter won’t affect
the results and will always coerce to a suitable dtype.

try_cast : boolean, default False

try to cast the result back to the input type (if possible),

raise_on_error : boolean, default True

Whether to raise on invalid data types (e.g. trying to where on
strings)

The mask method is an application of the if-then idiom. For each
element in the calling DataFrame, if cond is False the
element is used; otherwise the corresponding element from the DataFrame
other is used.