modin.pandas.Series.case_when¶
- Series.case_when(caselist) Series[source]¶
Replace values where the conditions are True.
- Parameters:
caselist (A list of tuples of conditions and expected replacements) – Takes the form:
(condition0, replacement0),(condition1, replacement1), … .conditionshould be a 1-D boolean array-like object or a callable. Ifconditionis a callable, it is computed on the Series and should return a boolean Series or array. The callable must not change the input Series (though pandas doesn`t check it).replacementshould be a 1-D array-like object, a scalar or a callable. Ifreplacementis a callable, it is computed on the Series and should return a scalar or Series. The callable must not change the input Series (though pandas doesn`t check it).- Return type:
See also
Series.maskReplace values where the condition is True.
Examples