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.wherewithaxis=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
othermust match corresponding entries in DataFrame. Noneor omitting argument defaults to the respectiveNAvalue for each type.
- Data types in
Note
DataFrame can contain categorical data if other is a scalar.