def train_val_datesplit(df, train_start, train_end, val_end, obs_col='obs'):
    """Split into training and validation sets based on dates"""
    train_df = df[(df.index >= train_start) & (df.index <= train_end)]
    val_df = df[(df.index > train_end) & (df.index <= val_end)]
    X_train = train_df.drop([obs_col], axis=1)
    y_train = train_df[[obs_col]]
    X_val = val_df.drop([obs_col], axis=1)
    y_val = val_df[[obs_col]]
    return X_train, y_train, X_val, y_val
