def where(self, cond: DataFrameOrSeries, other: Union[(DataFrameOrSeries, Any)]=np.nan, axis: Axis=None) -> 'DataFrame':
    '\n        Replace values where the condition is False.\n\n        Parameters\n        ----------\n        cond : boolean DataFrame\n            Where cond is True, keep the original value. Where False,\n            replace with corresponding value from other.\n        other : scalar, DataFrame\n            Entries where cond is False are replaced with corresponding value from other.\n        axis : int, default None\n            Can only be set to 0 at the moment for compatibility with pandas.\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.where(df1 > 0).sort_index()\n             A      B\n        0  NaN  100.0\n        1  1.0  200.0\n        2  2.0  300.0\n        3  3.0  400.0\n        4  4.0  500.0\n\n        >>> df1.where(df1 > 1, 10).sort_index()\n            A    B\n        0  10  100\n        1  10  200\n        2   2  300\n        3   3  400\n        4   4  500\n\n        >>> df1.where(df1 > 1, df1 + 100).sort_index()\n             A    B\n        0  100  100\n        1  101  200\n        2    2  300\n        3    3  400\n        4    4  500\n\n        >>> df1.where(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        When the column name of cond is different from self, it treats all values are False\n\n        >>> cond = ps.DataFrame({\'C\': [0, -1, -2, -3, -4], \'D\':[4, 3, 2, 1, 0]}) % 3 == 0\n        >>> cond\n               C      D\n        0   True  False\n        1  False   True\n        2  False  False\n        3   True  False\n        4  False   True\n\n        >>> df1.where(cond).sort_index()\n            A   B\n        0 NaN NaN\n        1 NaN NaN\n        2 NaN NaN\n        3 NaN NaN\n        4 NaN NaN\n\n        When the type of cond is Series, it just check boolean regardless of column name\n\n        >>> cond = ps.Series([1, 2]) > 1\n        >>> cond\n        0    False\n        1     True\n        dtype: bool\n\n        >>> df1.where(cond).sort_index()\n             A      B\n        0  NaN    NaN\n        1  1.0  200.0\n        2  NaN    NaN\n        3  NaN    NaN\n        4  NaN    NaN\n\n        >>> reset_option("compute.ops_on_diff_frames")\n        '
    from pyspark.pandas.series import Series
    axis = validate_axis(axis)
    if (axis != 0):
        raise NotImplementedError('axis should be either 0 or "index" currently.')
    tmp_cond_col_name = '__tmp_cond_col_{}__'.format
    tmp_other_col_name = '__tmp_other_col_{}__'.format
    psdf = self.copy()
    tmp_cond_col_names = [tmp_cond_col_name(name_like_string(label)) for label in self._internal.column_labels]
    if isinstance(cond, DataFrame):
        cond = cond[[(cond._internal.spark_column_for(label) if (label in cond._internal.column_labels) else SF.lit(False)).alias(name) for (label, name) in zip(self._internal.column_labels, tmp_cond_col_names)]]
        psdf[tmp_cond_col_names] = cond
    elif isinstance(cond, Series):
        cond = cond.to_frame()
        cond = cond[[cond._internal.data_spark_columns[0].alias(name) for name in tmp_cond_col_names]]
        psdf[tmp_cond_col_names] = cond
    else:
        raise TypeError('type of cond must be a DataFrame or Series')
    tmp_other_col_names = [tmp_other_col_name(name_like_string(label)) for label in self._internal.column_labels]
    if isinstance(other, DataFrame):
        other = other[[(other._internal.spark_column_for(label) if (label in other._internal.column_labels) else SF.lit(np.nan)).alias(name) for (label, name) in zip(self._internal.column_labels, tmp_other_col_names)]]
        psdf[tmp_other_col_names] = other
    elif isinstance(other, Series):
        other = other.to_frame()
        other = other[[other._internal.data_spark_columns[0].alias(name) for name in tmp_other_col_names]]
        psdf[tmp_other_col_names] = other
    else:
        for label in self._internal.column_labels:
            psdf[tmp_other_col_name(name_like_string(label))] = other
    data_spark_columns = []
    for label in self._internal.column_labels:
        data_spark_columns.append(F.when(psdf[tmp_cond_col_name(name_like_string(label))].spark.column, psdf._internal.spark_column_for(label)).otherwise(psdf[tmp_other_col_name(name_like_string(label))].spark.column).alias(psdf._internal.spark_column_name_for(label)))
    return DataFrame(psdf._internal.with_new_columns(data_spark_columns, column_labels=self._internal.column_labels))
Replace values where the condition is False.

Parameters
----------
cond : boolean DataFrame
    Where cond is True, keep the original value. Where False,
    replace with corresponding value from other.
other : scalar, DataFrame
    Entries where cond is False are replaced with corresponding value from other.
axis : int, default None
    Can only be set to 0 at the moment for compatibility with pandas.

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.where(df1 > 0).sort_index()
     A      B
0  NaN  100.0
1  1.0  200.0
2  2.0  300.0
3  3.0  400.0
4  4.0  500.0

>>> df1.where(df1 > 1, 10).sort_index()
    A    B
0  10  100
1  10  200
2   2  300
3   3  400
4   4  500

>>> df1.where(df1 > 1, df1 + 100).sort_index()
     A    B
0  100  100
1  101  200
2    2  300
3    3  400
4    4  500

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

When the column name of cond is different from self, it treats all values are False

>>> cond = ps.DataFrame({'C': [0, -1, -2, -3, -4], 'D':[4, 3, 2, 1, 0]}) % 3 == 0
>>> cond
       C      D
0   True  False
1  False   True
2  False  False
3   True  False
4  False   True

>>> df1.where(cond).sort_index()
    A   B
0 NaN NaN
1 NaN NaN
2 NaN NaN
3 NaN NaN
4 NaN NaN

When the type of cond is Series, it just check boolean regardless of column name

>>> cond = ps.Series([1, 2]) > 1
>>> cond
0    False
1     True
dtype: bool

>>> df1.where(cond).sort_index()
     A      B
0  NaN    NaN
1  1.0  200.0
2  NaN    NaN
3  NaN    NaN
4  NaN    NaN

>>> reset_option("compute.ops_on_diff_frames")
def where(self, cond: DataFrameOrSeries, other: Union[(DataFrameOrSeries, Any)]=np.nan, axis: Axis=None) -> 'DataFrame':
    '\n        Replace values where the condition is False.\n\n        Parameters\n        ----------\n        cond : boolean DataFrame\n            Where cond is True, keep the original value. Where False,\n            replace with corresponding value from other.\n        other : scalar, DataFrame\n            Entries where cond is False are replaced with corresponding value from other.\n        axis : int, default None\n            Can only be set to 0 at the moment for compatibility with pandas.\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.where(df1 > 0).sort_index()\n             A      B\n        0  NaN  100.0\n        1  1.0  200.0\n        2  2.0  300.0\n        3  3.0  400.0\n        4  4.0  500.0\n\n        >>> df1.where(df1 > 1, 10).sort_index()\n            A    B\n        0  10  100\n        1  10  200\n        2   2  300\n        3   3  400\n        4   4  500\n\n        >>> df1.where(df1 > 1, df1 + 100).sort_index()\n             A    B\n        0  100  100\n        1  101  200\n        2    2  300\n        3    3  400\n        4    4  500\n\n        >>> df1.where(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        When the column name of cond is different from self, it treats all values are False\n\n        >>> cond = ps.DataFrame({\'C\': [0, -1, -2, -3, -4], \'D\':[4, 3, 2, 1, 0]}) % 3 == 0\n        >>> cond\n               C      D\n        0   True  False\n        1  False   True\n        2  False  False\n        3   True  False\n        4  False   True\n\n        >>> df1.where(cond).sort_index()\n            A   B\n        0 NaN NaN\n        1 NaN NaN\n        2 NaN NaN\n        3 NaN NaN\n        4 NaN NaN\n\n        When the type of cond is Series, it just check boolean regardless of column name\n\n        >>> cond = ps.Series([1, 2]) > 1\n        >>> cond\n        0    False\n        1     True\n        dtype: bool\n\n        >>> df1.where(cond).sort_index()\n             A      B\n        0  NaN    NaN\n        1  1.0  200.0\n        2  NaN    NaN\n        3  NaN    NaN\n        4  NaN    NaN\n\n        >>> reset_option("compute.ops_on_diff_frames")\n        '
    from pyspark.pandas.series import Series
    axis = validate_axis(axis)
    if (axis != 0):
        raise NotImplementedError('axis should be either 0 or "index" currently.')
    tmp_cond_col_name = '__tmp_cond_col_{}__'.format
    tmp_other_col_name = '__tmp_other_col_{}__'.format
    psdf = self.copy()
    tmp_cond_col_names = [tmp_cond_col_name(name_like_string(label)) for label in self._internal.column_labels]
    if isinstance(cond, DataFrame):
        cond = cond[[(cond._internal.spark_column_for(label) if (label in cond._internal.column_labels) else SF.lit(False)).alias(name) for (label, name) in zip(self._internal.column_labels, tmp_cond_col_names)]]
        psdf[tmp_cond_col_names] = cond
    elif isinstance(cond, Series):
        cond = cond.to_frame()
        cond = cond[[cond._internal.data_spark_columns[0].alias(name) for name in tmp_cond_col_names]]
        psdf[tmp_cond_col_names] = cond
    else:
        raise TypeError('type of cond must be a DataFrame or Series')
    tmp_other_col_names = [tmp_other_col_name(name_like_string(label)) for label in self._internal.column_labels]
    if isinstance(other, DataFrame):
        other = other[[(other._internal.spark_column_for(label) if (label in other._internal.column_labels) else SF.lit(np.nan)).alias(name) for (label, name) in zip(self._internal.column_labels, tmp_other_col_names)]]
        psdf[tmp_other_col_names] = other
    elif isinstance(other, Series):
        other = other.to_frame()
        other = other[[other._internal.data_spark_columns[0].alias(name) for name in tmp_other_col_names]]
        psdf[tmp_other_col_names] = other
    else:
        for label in self._internal.column_labels:
            psdf[tmp_other_col_name(name_like_string(label))] = other
    data_spark_columns = []
    for label in self._internal.column_labels:
        data_spark_columns.append(F.when(psdf[tmp_cond_col_name(name_like_string(label))].spark.column, psdf._internal.spark_column_for(label)).otherwise(psdf[tmp_other_col_name(name_like_string(label))].spark.column).alias(psdf._internal.spark_column_name_for(label)))
    return DataFrame(psdf._internal.with_new_columns(data_spark_columns, column_labels=self._internal.column_labels))