def select_window(series, window):
    """Helper Function to select a portion of
    pandas time series

    :param series: Input Time Series data
    :type series: :mod:`pandas.Series`

    :param window: A tuple indicating a time window
    :type window: tuple
    """
    if not window:
        return series
    start, stop = window
    ix = series.index
    selector = (ix >= start) & (ix <= stop)
    window_series = series[selector]
    return window_series
