Skip to content

Commit 87fa521

Browse files
author
miranov25
committed
adding chunksize and compression as argument
1 parent cb4b5d1 commit 87fa521

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

UTILS/dfextensions/groupby_regression.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ def process_group_robust(
116116
) -> dict:
117117
group_dict = dict(zip(gb_columns, key))
118118
predictors = []
119+
if isinstance(weights, str) and weights not in df_group.columns:
120+
raise ValueError(f"Weight column '{weights}' not found in input DataFrame.")
119121

120122
for i, col in enumerate(linear_columns0):
121123
required_columns = [col] + fit_columns + [weights]
@@ -248,6 +250,9 @@ def make_parallel_fit(
248250
Returns:
249251
Tuple[pd.DataFrame, pd.DataFrame]: DataFrame with predictions and group-level statistics.
250252
"""
253+
if isinstance(weights, str) and weights not in df.columns:
254+
raise ValueError(f"Weight column '{weights}' not found in input DataFrame")
255+
251256
df_selected = df.loc[selection]
252257
grouped = df_selected.groupby(gb_columns)
253258

0 commit comments

Comments
 (0)