datetime_to_index

postprocessinglib.utilities._helper_functions.datetime_to_index(datetime: str) tuple[int, int]

Convert the datetime value to index value for use in the dataframe

Parameters:

datetime (str) – a string containing the date being searched for entered in the format “yyyy-mm-dd”

Returns:

tuple – an index representing the year and jday index of the dataframe

Return type:

[int, int]

Example

>>> #Convert the follwing datetime values to index values: "2020-01-01", "1995-12-31", "2000-02-29"
>>> from postprocessinglib.utilities import _helper_functions
>>> _helper_functions.datetime_to_index("2020-01-01")
    (2020, 1)
>>> _helper_functions.datetime_to_index("1995-12-31")
    (1995, 365)
>>> _helper_functions.datetime_to_index("2000-02-29")
    (2000, 60)