From 836227d72e4d8acbe163586f164aeed383fd40e5 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 21 Dec 2023 16:49:55 +0100 Subject: [PATCH] feat(script): Add breakdown by region visualization --- scoping_review.qmd | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/scoping_review.qmd b/scoping_review.qmd index f7bab5c..2d48d66 100644 --- a/scoping_review.qmd +++ b/scoping_review.qmd @@ -638,6 +638,26 @@ many studies use income measurements and changes in income or income inequality {{++ TODO: describe inequality type distribution for overall dataset ++}} +```{python} +#| label: fig-region-counts +#| fig-cap: Studies by regions analysed + +bib_df = (bib_df + .assign( + # create de-duplicated joins for all observations + region=lambda _df: _df["region"].apply( + lambda _cell: set([x.strip() for x in _cell.split(";")]) + ), + ) + .explode("region") +) +# bib_df["region"] = bib_df["region"].str.split(";").explode().str.strip() +ax = sns.countplot(bib_df, x="region", order=bib_df["region"].value_counts().index) +plt.setp(ax.get_xticklabels(), rotation=45, ha="right", + rotation_mode="anchor") +plt.show() +``` + # Synthesis of Evidence --- a multitude of lenses This section will present a synthesis of evidence from the scoping review.