foundryts.functions.timestamp_scale

foundryts.functions.timestamp_scale(factor)

(DEPRECATED) Returns a function that multiplies each timestamp of a single time series by the specified integer factor.

For a source time series with points (timestamp, value), upon scaling by factor, the resulting time-scaled time series will have points (timestamp * factor, value).

  • Parameters: factor (int) – The scaling factor that is multiplied with each timestamp in the series.
  • Returns: A function that accepts a single time series as input and returns the time-scaled time series.
  • Return type: (FunctionNode) -> FunctionNode

Dataframe schema

Column nameTypeDescription
timestamppandas.TimestampTimestamp of the point
valuefloatScaled value of the point
Note

This operation is deprecated and performs a no-op, leaving the resulting time series unchanged. This function will be removed from future releases.

The backend will automatically unify different time-units to the same unit.

Examples

Copied!
1 2 3 4 5 6 7 8 9 10 11 12 13 >>> series = F.points( ... (1, 1.0), ... (101, 2.0), ... (200, 4.0), ... (201, 8.0), ... name="series", ... ) >>> series.to_pandas() timestamp value 0 1970-01-01 00:00:00.000000001 1.0 1 1970-01-01 00:00:00.000000101 2.0 2 1970-01-01 00:00:00.000000200 4.0 3 1970-01-01 00:00:00.000000201 8.0
Copied!
1 2 3 4 5 6 7 >>> timescaled_series = F.timestamp_scale(99)(series) # NO-OP, DEPRECATED OPERATION >>> timescaled_series.to_pandas() # resulting series is unchanged timestamp value 0 1970-01-01 00:00:00.000000001 1.0 1 1970-01-01 00:00:00.000000101 2.0 2 1970-01-01 00:00:00.000000200 4.0 3 1970-01-01 00:00:00.000000201 8.0