We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3133ab1 commit 5898ae7Copy full SHA for 5898ae7
statistical_methods_library/estimation.py
@@ -194,15 +194,15 @@ def estimate(
194
.groupBy([period_col, strata_col])
195
.agg(count(col(sample_marker_col)))
196
)
197
- death_sample = (
+ if (
198
death_df.join(sample_df, ["period", "strata"], "left")
199
.fillna(0, ["count(sample_inclusion_marker)"])
200
.filter(
201
(col("count(death_marker)")) > (col("count(sample_inclusion_marker)"))
202
203
- )
204
- if death_sample.count():
205
- raise ValidationError(f"The death count must be less than sample count.")
+ .count()
+ ) >= 1:
+ raise ValidationError("The death count must be less than sample count.")
206
207
# --- prepare our working data frame ---
208
col_list = [
0 commit comments