diff --git a/lectures/applications/recidivism.md b/lectures/applications/recidivism.md index bc36dd41..7ef51c8b 100644 --- a/lectures/applications/recidivism.md +++ b/lectures/applications/recidivism.md @@ -177,7 +177,7 @@ is mostly African-American or Caucasian. We now look into how recidivism is split across groups. ```{code-cell} python -recid = df.groupby(["age_cat", "sex", "race"])["two_year_recid"].mean().unstack(level="race") +recid = df.groupby(["age_cat", "sex", "race"], observed=True)["two_year_recid"].mean().unstack(level="race") recid ```