diff --git a/presto/inference.py b/presto/inference.py index d8f9d14..87c3321 100644 --- a/presto/inference.py +++ b/presto/inference.py @@ -402,12 +402,13 @@ def process_parquet(df: pd.DataFrame) -> pd.DataFrame: (((df["timestamp"] - df["end_date"]).dt.days + 365) / 30).round().astype(int) ) + # Now reassign start_date to the actual subset counted back from end_date + df["start_date"] = df["end_date"] - pd.Timedelta(days=364) + df_pivot = df[(df["valid_date_ind"] >= 0) & (df["valid_date_ind"] < 12)].pivot( index=index_columns, columns="valid_date_ind", values=feature_columns ) - # Now reassign start_date to the actual subset counted back from end_date - df["start_date"] = df["end_date"] - pd.Timedelta(days=364) # ---------------------------------------------------------------------------- if df_pivot.empty: