diff --git a/scripts/data_collector/utils.py b/scripts/data_collector/utils.py index 31170de7d0..1bcace33c7 100644 --- a/scripts/data_collector/utils.py +++ b/scripts/data_collector/utils.py @@ -686,7 +686,7 @@ def _calc_factor(df_1d: pd.DataFrame): df_1d["paused"] = np.nan return df_1d - df = df.groupby([df[_date_field_name].dt.date]).apply(_calc_factor) + df = df.groupby([df[_date_field_name].dt.date], group_keys=False).apply(_calc_factor) if consistent_1d: # the date sequence is consistent with 1d df.set_index(_date_field_name, inplace=True) diff --git a/scripts/data_collector/yahoo/collector.py b/scripts/data_collector/yahoo/collector.py index 869eb63fc2..1d45d93afa 100644 --- a/scripts/data_collector/yahoo/collector.py +++ b/scripts/data_collector/yahoo/collector.py @@ -971,7 +971,7 @@ def update_data_to_bin( # start/end date calendar_df = pd.read_csv(Path(qlib_data_1d_dir).joinpath("calendars/day.txt")) - trading_date = (pd.Timestamp(calendar_df.iloc[-1, 0]) - pd.Timedelta(days=2)).strftime("%Y-%m-%d") + trading_date = (pd.Timestamp(calendar_df.iloc[-1, 0]) - pd.Timedelta(days=1)).strftime("%Y-%m-%d") if end_date is None: end_date = (pd.Timestamp(trading_date) + pd.Timedelta(days=1)).strftime("%Y-%m-%d")