cudf.Series.rfloordiv#
- Series.rfloordiv(other, level=None, fill_value=None, axis=0)#
Get Integer division of dataframe or series and other, element-wise (binary operator rfloordiv).
Equivalent to
other // dataframe
, but with support to substitute a fill_value for missing data in one of the inputs. With reverse version, floordiv.- Parameters
- otherscalar, sequence, Series, or DataFrame
Any single or multiple element data structure, or list-like object.
- axisint or string
Only
0
is supported for series,1
orcolumns
supported for dataframe- fill_valuefloat or None, default None
Fill existing missing (NaN) values, and any new element needed for successful DataFrame alignment, with this value before computation. If data in both corresponding DataFrame locations is missing the result will be missing.
- Returns
- DataFrame or Series
Result of the arithmetic operation.
Examples
DataFrame
>>> import cudf >>> df = cudf.DataFrame({'col1': [10, 11, 23], ... 'col2': [101, 122, 321]}) >>> df col1 col2 0 10 101 1 11 122 2 23 321 >>> df.rfloordiv(df) col1 col2 0 1 1 1 1 1 2 1 1 >>> df.rfloordiv(200) col1 col2 0 20 1 1 18 1 2 8 0 >>> df.rfloordiv(100) col1 col2 0 10 0 1 9 0 2 4 0
Series
>>> import cudf >>> s = cudf.Series([1, 2, 10, 17]) >>> s 0 1 1 2 2 10 3 17 dtype: int64 >>> s.rfloordiv(100) 0 100 1 50 2 10 3 5 dtype: int64 >>> s = cudf.Series([10, 20, None]) >>> s 0 10 1 20 2 <NA> dtype: int64 >>> s.rfloordiv(200) 0 20 1 10 2 <NA> dtype: int64 >>> s.rfloordiv(200, fill_value=2) 0 20 1 10 2 100 dtype: int64