From 2b986b46a6f697116bb32a1b099324c06148ca80 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 29 Jul 2024 12:50:18 +0200 Subject: [PATCH] chore(script): Fix type error --- manuscript/article.qmd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/manuscript/article.qmd b/manuscript/article.qmd index 439eff1..361e405 100644 --- a/manuscript/article.qmd +++ b/manuscript/article.qmd @@ -593,6 +593,7 @@ the overall output volume strongly increased during this period. ```{python} #| label: fig-publications-per-year #| fig-cap: Publications per year +from typing import cast df_study_years = ( df.groupby(["author", "year", "title"]) @@ -602,6 +603,8 @@ df_study_years = ( ["year"].value_counts() .sort_index() ) +df_study_years = cast(pd.DataFrame, df_study_years) # fix potential type errors + # use order to ensure all years are displayed, even ones without values years_range = list(range(df_study_years.index.min(), df_study_years.index.max()+1)) ax = sns.barplot(df_study_years, order=years_range)