gs_quant.timeseries.datetime.value¶
- value(x, date, method=Interpolate.STEP)[source]¶
Value at specified date or time
- Parameters:
x (
Series
) – timeseriesdate (
Union
[date
,time
]) – requested date or timemethod (
Interpolate
) – interpolation method (default: step)
- Return type:
Series
- Returns:
value at specified date or time
Usage
Returns the value of series X at the specified date:
\(Y_t = X_{date}\)
If the requested date or time is not present in the series, the value function will return the value from the previous available date or time by default. Caller can specify other interpolation styles via the method param:
Interpolation methods:
Type
Behavior
intersect
Only returns a value for valid dates
nan
Value will be NaN for dates not present in the series
zero
Value will be zero for dates not present in the series
step
Value of the previous valid point if requested date does not exist. Values prior to the first date will be equivalent to the first available value
Examples
Value of series on 5Mar18:
>>> a = generate_series(100) >>> value(a, date(2019, 1, 3)
See also