def get_sub_timeseries(df_x, index, window_start, window_end, identifier):
    """
    Helper method which extracts a sub dataframe of a pandas dataframe. The sub dataframe is defined by a
    index aswell as the relative start end end index of the window. An identifier column is added with a
    constant value which is given as parameter. This ensures multiple sub dataframes can be distinguished
    from each other.

    Example:
    -----[|-----------|-----------|----------|]------------|-------------|---------------->
      index-window_end                 index-window_start              index

    Because iloc is not supported in dask dataframes it is assumed the index equals the level of the row
    (like reset_index does).
    :param df_x: the pandas dataframe the sub dataframe should be extracted
    :param index: absolute index of the dataframe the window is extracted
    :param window_start: relative start of the subwindow
    :param window_end: relative end of the subwindow
    :param identifier: a unique constant identifier to distinguish later the sub dataframe
    :return: the extracted sub dataframe
    """
    sub_df_x = df_x.iloc[index - window_end:index - window_start]
    sub_df_x['window_id'] = identifier
    return sub_df_x