def make_X_y_timeseries_data(data, x_window=35, verbose=2, as_array=True):
    """Creates an X and Y time sequence trianing set from a pandas Series.
    - X_train is a an array with x_window # of samples for each row in X_train
    - y_train is one value per X_train window: the next time point after the X_window.
    Verbose determines details printed about the contents and shapes of the data.

    # Example Usage:
    X_train, y_train = make_X_y_timeseries(df['price'], x_window= 35)
    print( X_train[0]]):
    # returns: arr[X1,X2...X35]
    print(y_train[0])
    # returns  X36
    """
    import numpy as np
    import pandas as pd
    if any(data.isna()):
        raise Exception('Function does not accept null values')
    if verbose > 0:
        print(f'Input Range: {np.min(data)} - {np.max(data)}')
        print(f'Input Shape: {np.shape(data)}\n')
    time_index_in = data.index
    time_index = data.index[x_window:]
    X_train, y_train = [], []
    check_time_index = []
    for i in range(x_window, data.shape[0]):
        check_time_index.append([data.index[i - x_window], data.index[i]])
        X_train.append(data.iloc[i - x_window:i])
        y_train.append(data.iloc[i])
    if as_array == True:
        X_train, y_train = np.array(X_train), np.array(y_train)
    if verbose > 0:
        print(f'\nOutput Shape - X: {X_train.shape}')
        print(f'Output Shape - y: {y_train.shape}')
        print(
            f"""
Timeindex Shape: {np.shape(time_index)}
	Range: {time_index[0]}-{time_index[-1]}"""
            )
        print(f'\tFrequency:', time_index.freq)
    return X_train, y_train, time_index
