gs_quant.timeseries.algebra.floordiv¶
- floordiv(x, y, method=Interpolate.STEP)[source]¶
Floor divide two series or scalars
- Parameters:
x (
Union
[Series
,Real
]) – timeseries or scalary (
Union
[Series
,Real
]) – timeseries or scalarmethod (
Interpolate
) – interpolation method (default: step). Only used for operating two series
- Return type:
Union
[Series
,Real
]- Returns:
timeseries of x // y or quotient of the floor division of the given real numbers
Usage
Divide two series or scalar variables applying the given interpolation method
\(R_t = X_t / Y_t\)
Alignment operators:
Method
Behavior
intersect
Resultant series only has values on the intersection of dates. Values for dates present in only one series will be ignored
nan
Resultant series has values on the union of dates in both series. Values for dates only available in one series will be treated as nan in the other series, and therefore in the resultant series
zero
Resultant series has values on the union of dates in both series. Values for dates only available in one series will be treated as zero in the other series
step
Resultant series has values on the union of dates in both series. Values for dates only available in one series will be interpolated via step function in the other series
Examples
Floor divide two series:
>>> a = generate_series(100) >>> b = generate_series(100) >>> floordiv(a, b, Interpolate.STEP)
See also