def mask(self, cond: DataFrameOrSeries, other: Union[(DataFrameOrSeries, Any)]=np.nan) -> 'DataFrame':
    '\n        Replace values where the condition is True.\n\n        Parameters\n        ----------\n        cond : boolean DataFrame\n            Where cond is False, keep the original value. Where True,\n            replace with corresponding value from other.\n        other : scalar, DataFrame\n            Entries where cond is True are replaced with corresponding value from other.\n\n        Returns\n        -------\n        DataFrame\n\n        Examples\n        --------\n\n        >>> from pyspark.pandas.config import set_option, reset_option\n        >>> set_option("compute.ops_on_diff_frames", True)\n        >>> df1 = ps.DataFrame({\'A\': [0, 1, 2, 3, 4], \'B\':[100, 200, 300, 400, 500]})\n        >>> df2 = ps.DataFrame({\'A\': [0, -1, -2, -3, -4], \'B\':[-100, -200, -300, -400, -500]})\n        >>> df1\n           A    B\n        0  0  100\n        1  1  200\n        2  2  300\n        3  3  400\n        4  4  500\n        >>> df2\n           A    B\n        0  0 -100\n        1 -1 -200\n        2 -2 -300\n        3 -3 -400\n        4 -4 -500\n\n        >>> df1.mask(df1 > 0).sort_index()\n             A   B\n        0  0.0 NaN\n        1  NaN NaN\n        2  NaN NaN\n        3  NaN NaN\n        4  NaN NaN\n\n        >>> df1.mask(df1 > 1, 10).sort_index()\n            A   B\n        0   0  10\n        1   1  10\n        2  10  10\n        3  10  10\n        4  10  10\n\n        >>> df1.mask(df1 > 1, df1 + 100).sort_index()\n             A    B\n        0    0  200\n        1    1  300\n        2  102  400\n        3  103  500\n        4  104  600\n\n        >>> df1.mask(df1 > 1, df2).sort_index()\n           A    B\n        0  0 -100\n        1  1 -200\n        2 -2 -300\n        3 -3 -400\n        4 -4 -500\n\n        >>> reset_option("compute.ops_on_diff_frames")\n        '
    from pyspark.pandas.series import Series
    if (not isinstance(cond, (DataFrame, Series))):
        raise TypeError('type of cond must be a DataFrame or Series')
    cond_inversed = cond._apply_series_op((lambda psser: (~ psser)))
    return self.where(cond_inversed, other)
Replace values where the condition is True.

Parameters
----------
cond : boolean DataFrame
    Where cond is False, keep the original value. Where True,
    replace with corresponding value from other.
other : scalar, DataFrame
    Entries where cond is True are replaced with corresponding value from other.

Returns
-------
DataFrame

Examples
--------

>>> from pyspark.pandas.config import set_option, reset_option
>>> set_option("compute.ops_on_diff_frames", True)
>>> df1 = ps.DataFrame({'A': [0, 1, 2, 3, 4], 'B':[100, 200, 300, 400, 500]})
>>> df2 = ps.DataFrame({'A': [0, -1, -2, -3, -4], 'B':[-100, -200, -300, -400, -500]})
>>> df1
   A    B
0  0  100
1  1  200
2  2  300
3  3  400
4  4  500
>>> df2
   A    B
0  0 -100
1 -1 -200
2 -2 -300
3 -3 -400
4 -4 -500

>>> df1.mask(df1 > 0).sort_index()
     A   B
0  0.0 NaN
1  NaN NaN
2  NaN NaN
3  NaN NaN
4  NaN NaN

>>> df1.mask(df1 > 1, 10).sort_index()
    A   B
0   0  10
1   1  10
2  10  10
3  10  10
4  10  10

>>> df1.mask(df1 > 1, df1 + 100).sort_index()
     A    B
0    0  200
1    1  300
2  102  400
3  103  500
4  104  600

>>> df1.mask(df1 > 1, df2).sort_index()
   A    B
0  0 -100
1  1 -200
2 -2 -300
3 -3 -400
4 -4 -500

>>> reset_option("compute.ops_on_diff_frames")
def mask(self, cond: DataFrameOrSeries, other: Union[(DataFrameOrSeries, Any)]=np.nan) -> 'DataFrame':
    '\n        Replace values where the condition is True.\n\n        Parameters\n        ----------\n        cond : boolean DataFrame\n            Where cond is False, keep the original value. Where True,\n            replace with corresponding value from other.\n        other : scalar, DataFrame\n            Entries where cond is True are replaced with corresponding value from other.\n\n        Returns\n        -------\n        DataFrame\n\n        Examples\n        --------\n\n        >>> from pyspark.pandas.config import set_option, reset_option\n        >>> set_option("compute.ops_on_diff_frames", True)\n        >>> df1 = ps.DataFrame({\'A\': [0, 1, 2, 3, 4], \'B\':[100, 200, 300, 400, 500]})\n        >>> df2 = ps.DataFrame({\'A\': [0, -1, -2, -3, -4], \'B\':[-100, -200, -300, -400, -500]})\n        >>> df1\n           A    B\n        0  0  100\n        1  1  200\n        2  2  300\n        3  3  400\n        4  4  500\n        >>> df2\n           A    B\n        0  0 -100\n        1 -1 -200\n        2 -2 -300\n        3 -3 -400\n        4 -4 -500\n\n        >>> df1.mask(df1 > 0).sort_index()\n             A   B\n        0  0.0 NaN\n        1  NaN NaN\n        2  NaN NaN\n        3  NaN NaN\n        4  NaN NaN\n\n        >>> df1.mask(df1 > 1, 10).sort_index()\n            A   B\n        0   0  10\n        1   1  10\n        2  10  10\n        3  10  10\n        4  10  10\n\n        >>> df1.mask(df1 > 1, df1 + 100).sort_index()\n             A    B\n        0    0  200\n        1    1  300\n        2  102  400\n        3  103  500\n        4  104  600\n\n        >>> df1.mask(df1 > 1, df2).sort_index()\n           A    B\n        0  0 -100\n        1  1 -200\n        2 -2 -300\n        3 -3 -400\n        4 -4 -500\n\n        >>> reset_option("compute.ops_on_diff_frames")\n        '
    from pyspark.pandas.series import Series
    if (not isinstance(cond, (DataFrame, Series))):
        raise TypeError('type of cond must be a DataFrame or Series')
    cond_inversed = cond._apply_series_op((lambda psser: (~ psser)))
    return self.where(cond_inversed, other)