pd.DataFrame.where¶
pandas.DataFrame.where(cond, other=np.nan, inplace=False, axis=1, level=None, errors='raise', try_cast=NoDefault.no_default)
Supported Arguments¶
cond
: Boolean DataFrame, Boolean Series, Boolean Array- If 1-dimensional array or Series is provided, equivalent to Pandas
df.where
withaxis=1
.
- If 1-dimensional array or Series is provided, equivalent to Pandas
other
: Scalar, DataFrame, Series, 1 or 2-D Array,None
- Data types in
other
must match corresponding entries in DataFrame. None
or omitting argument defaults to the respectiveNA
value for each type.
- Data types in
Note
DataFrame can contain categorical data if other
is a scalar.