pyspark.pandas.Series.rmod

Series.rmod(other: Any) → pyspark.pandas.series.Series[source]

Return Reverse Modulo of series and other, element-wise (binary operator %).

Equivalent to other % series

Parameters
otherSeries or scalar value
Returns
Series

The result of the operation.

See also

Series.mod

Examples

>>> df = ps.DataFrame({'a': [2, 2, 4, np.nan],
...                    'b': [2, np.nan, 2, np.nan]},
...                   index=['a', 'b', 'c', 'd'], columns=['a', 'b'])
>>> df
     a    b
a  2.0  2.0
b  2.0  NaN
c  4.0  2.0
d  NaN  NaN
>>> df.a.mod(df.b)
a    0.0
b    NaN
c    0.0
d    NaN
dtype: float64
>>> df.a.rmod(df.b)
a    0.0
b    NaN
c    2.0
d    NaN
dtype: float64