chore(script): Fix type error
This commit is contained in:
parent
bd25353fa1
commit
2b986b46a6
1 changed files with 3 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue