determine_num_steps

determine_num_steps(start_timestamp: pandas._libs.tslibs.timestamps.Timestamp, end_timestamp: pandas._libs.tslibs.timestamps.Timestamp, freq: str) int[source]

Determine how many steps of freq should we make from start_timestamp to reach end_timestamp.

Parameters
  • start_timestamp (pandas._libs.tslibs.timestamps.Timestamp) – timestamp to start counting from

  • end_timestamp (pandas._libs.tslibs.timestamps.Timestamp) – timestamp to end counting, should be not earlier than start_timestamp

  • freq (str) – pandas frequency string: Offset aliases

Returns

number of steps

Raises
  • ValueError: – Value of end timestamp is less than start timestamp

  • ValueError: – Start timestamp isn’t correct according to a given frequency

  • ValueError: – End timestamp isn’t reachable with a given frequency

Return type

int