From 175d1be4d8cf0ebebb2618ca94e4840c264db691 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 6 Sep 2022 17:55:08 +0200 Subject: [PATCH] Add development assistance template to Djibouti, Uganda, Vietnam Requires refactoring for individual topic of development and descriptive additions. --- _drivers-of-inequality-djibouti.qmd | 91 +++++++++++++++++++++++++++++ _drivers-of-inequality-uganda.qmd | 91 +++++++++++++++++++++++++++++ _drivers-of-inequality-vietnam.qmd | 91 +++++++++++++++++++++++++++++ 3 files changed, 273 insertions(+) diff --git a/_drivers-of-inequality-djibouti.qmd b/_drivers-of-inequality-djibouti.qmd index 3444ea0..6125109 100644 --- a/_drivers-of-inequality-djibouti.qmd +++ b/_drivers-of-inequality-djibouti.qmd @@ -111,4 +111,95 @@ with the nomadic population decreasing by nearly three quarters and many fleeing Women face less opportunity in the country with worse upward educational mobility, less participation in the labor force, higher unemployment rates, and a continuing, if closing, gender literacy gap. Djibouti is set to miss most of its poverty target levels and move along a growth pathway that does not lend itself to inclusion unless active policy measures changing its economic investment and growth strategies are examined. + +### Development assistance to Djibouti + +```{python} +# Load CRS data +dfsub1 = pd.read_csv('data/raw/OECD_CRS/CRS1_Djibouti_11-13_05092022210301944.csv', parse_dates=True, low_memory=False) +dfsub2 = pd.read_csv('data/raw/OECD_CRS/CRS1_Djibouti_14-16_05092022210632022.csv', parse_dates=True, low_memory=False) +dfsub3 = pd.read_csv('data/raw/OECD_CRS/CRS1_Djibouti_17-20_05092022210913679.csv', parse_dates=True, low_memory=False) +df = pd.concat([dfsub1, dfsub2, dfsub3], ignore_index=True) +df = df.rename(columns={'\ufeff"DONOR"': 'DONOR'}) +``` + +```{python} +#| label: fig-dji-aid-financetype +#| fig-cap: "Total ODA for Djibouti per year, by financing type" +#| column: page +totals = df.loc[ + (df['SECTOR'] == 1000) & # Total + (df['CHANNEL'] == 100) & + (df['AMOUNTTYPE'] == 'D') & + (df['FLOWTYPE'] == 112) & + (df['AIDTYPE'] == "100") # contains mixed int and string representations + ] +financetotals = totals.copy() +financetotals = financetotals[financetotals['DONOR'] < 20000] # drop all 'total' aggregations + +## count amount of development aid financing instruments (grants/loans) by year and display +## count USD amount of development aid financing instumrnets by year and display +financetotals_grouped = financetotals.groupby(['Flow', 'Year']).agg({'Value': ['sum']}) +financetotals_grouped = financetotals_grouped.reset_index(['Flow', 'Year']) +financetotals_grouped.columns = financetotals_grouped.columns.to_flat_index() +financetotals_grouped.columns = ['Financetype', 'Year', 'Value'] + +fig = px.line(financetotals_grouped, x='Year', y='Value', color='Financetype', labels={"Value": "Development aid, in millions"}, markers=True, template="seaborn") +fig.show() +``` + +Note: Values shown are for all Official Development Assistance flows valid under the OECD CRS data, split into the type of financing flow, calculated as constant currency (2020 corrected) USD millions. +Source: Author's elaboration based on OECD ODA CRS (2022). + +```{python} +#| label: fig-dji-aid-donortype +#| fig-cap: "Total ODA for Djibouti per year, separated by donor type" +#| column: page +totals = df.loc[ + (df['SECTOR'] == 1000) & # Total + (df['FLOW'] == 100) & + (df['CHANNEL'] == 100) & + (df['AMOUNTTYPE'] == 'D') & + (df['FLOWTYPE'] == 112) & + (df['AIDTYPE'] == "100") # contains mixed int and string representations + ] +donortotals = totals.copy() +donortotals["Donortype"] = donortotals["DONOR"].map(donortypes) +donortotals = donortotals[(donortotals["Donortype"] != "nondac")] + +donortotals_grouped = donortotals.groupby(['Donortype', 'Year']).agg({'Value': ['sum']}) +donortotals_grouped = donortotals_grouped.reset_index(['Donortype', 'Year']) +donortotals_grouped.columns = donortotals_grouped.columns.to_flat_index() +donortotals_grouped.columns = ['Donortype', 'Year', 'Value'] +fig = px.line(donortotals_grouped, x='Year', y='Value', color='Donortype', labels={"Value": "Development aid, in millions"}, markers=True, template="seaborn") +fig.show() +``` + +Note: Values shown are for all Official Development Assistance flows valid under the OECD ODA data, split into bilateral development donor countries (dac), bilateral non-DAC countries (nondac) and multilateral donors (multilateral), as constant currency (2020 corrected) USD millions. +Source: Author's elaboration based on OECD ODA CRS (2022). + +```{python} +#| label: tbl-dji-aid-electricity +#| tbl-cap: "ODA for transmission and distribution of electric power in Djibouti per year, separated by financing type" +#| column: page +totals = df.loc[ + ((df['SECTOR'] == 23630) | (df['SECTOR'] == 23631)) & # Total + (df['CHANNEL'] == 100) & + (df['AMOUNTTYPE'] == 'D') & + ((df['FLOW'] == 11) | (df['FLOW'] == 13)) & # Total + (df['FLOWTYPE'] == 112) & + (df['AIDTYPE'] == "100") # contains mixed int and string representations + ] +electricityaid = totals[totals['DONOR'] < 20000] # drop all 'total' aggregations + +pd.options.display.float_format = "{:.2f}".format + +el_grouped = electricityaid.groupby(['Year', 'Flow']).agg({'Value': ['sum']}) +el_grouped.style.format(escape="latex") +el_grouped +``` + +Note: Values shown are for all Official Development Assistance flows valid under the OECD CRS data, split into the type of financing flow, calculated as constant currency (2020 corrected) USD millions. The category under analysis is Electric Power transmission and distribution (centralized grids) within the data. +Source: Author's elaboration based on OECD ODA CRS (2022). + {{< pagebreak >}} diff --git a/_drivers-of-inequality-uganda.qmd b/_drivers-of-inequality-uganda.qmd index 108aaad..b53c0bf 100644 --- a/_drivers-of-inequality-uganda.qmd +++ b/_drivers-of-inequality-uganda.qmd @@ -143,4 +143,95 @@ In the district of Isingiro in West Uganda access to water is considerably below with policy failures during implementation now leading to partly or non-functional water sources. The problem runs danger of deteriorating with an increased amount of climate shocks such as droughts threatening to exacerbate existing inequalities and drive further households into poverty. + +### Development assistance to Uganda + +```{python} +# Load CRS data +dfsub1 = pd.read_csv('data/raw/OECD_CRS/CRS1_Uganda_11-13_05092022214241555.csv', parse_dates=True, low_memory=False) +dfsub2 = pd.read_csv('data/raw/OECD_CRS/CRS1_Uganda_14-16_05092022213749491.csv', parse_dates=True, low_memory=False) +dfsub3 = pd.read_csv('data/raw/OECD_CRS/CRS1_Uganda_17-20_05092022213356210.csv', parse_dates=True, low_memory=False) +df = pd.concat([dfsub1, dfsub2, dfsub3], ignore_index=True) +df = df.rename(columns={'\ufeff"DONOR"': 'DONOR'}) +``` + +```{python} +#| label: fig-uga-aid-financetype +#| fig-cap: "Total ODA for Uganda per year, by financing type" +#| column: page +totals = df.loc[ + (df['SECTOR'] == 1000) & # Total + (df['CHANNEL'] == 100) & + (df['AMOUNTTYPE'] == 'D') & + (df['FLOWTYPE'] == 112) & + (df['AIDTYPE'] == "100") # contains mixed int and string representations + ] +financetotals = totals.copy() +financetotals = financetotals[financetotals['DONOR'] < 20000] # drop all 'total' aggregations + +## count amount of development aid financing instruments (grants/loans) by year and display +## count USD amount of development aid financing instumrnets by year and display +financetotals_grouped = financetotals.groupby(['Flow', 'Year']).agg({'Value': ['sum']}) +financetotals_grouped = financetotals_grouped.reset_index(['Flow', 'Year']) +financetotals_grouped.columns = financetotals_grouped.columns.to_flat_index() +financetotals_grouped.columns = ['Financetype', 'Year', 'Value'] + +fig = px.line(financetotals_grouped, x='Year', y='Value', color='Financetype', labels={"Value": "Development aid, in millions"}, markers=True, template="seaborn") +fig.show() +``` + +Note: Values shown are for all Official Development Assistance flows valid under the OECD CRS data, split into the type of financing flow, calculated as constant currency (2020 corrected) USD millions. +Source: Author's elaboration based on OECD ODA CRS (2022). + +```{python} +#| label: fig-uga-aid-donortype +#| fig-cap: "Total ODA for Uganda per year, separated by donor type" +#| column: page +totals = df.loc[ + (df['SECTOR'] == 1000) & # Total + (df['FLOW'] == 100) & + (df['CHANNEL'] == 100) & + (df['AMOUNTTYPE'] == 'D') & + (df['FLOWTYPE'] == 112) & + (df['AIDTYPE'] == "100") # contains mixed int and string representations + ] +donortotals = totals.copy() +donortotals["Donortype"] = donortotals["DONOR"].map(donortypes) +donortotals = donortotals[(donortotals["Donortype"] != "nondac")] + +donortotals_grouped = donortotals.groupby(['Donortype', 'Year']).agg({'Value': ['sum']}) +donortotals_grouped = donortotals_grouped.reset_index(['Donortype', 'Year']) +donortotals_grouped.columns = donortotals_grouped.columns.to_flat_index() +donortotals_grouped.columns = ['Donortype', 'Year', 'Value'] +fig = px.line(donortotals_grouped, x='Year', y='Value', color='Donortype', labels={"Value": "Development aid, in millions"}, markers=True, template="seaborn") +fig.show() +``` + +Note: Values shown are for all Official Development Assistance flows valid under the OECD ODA data, split into bilateral development donor countries (dac), bilateral non-DAC countries (nondac) and multilateral donors (multilateral), as constant currency (2020 corrected) USD millions. +Source: Author's elaboration based on OECD ODA CRS (2022). + +```{python} +#| label: tbl-uga-aid-electricity +#| tbl-cap: "ODA for transmission and distribution of electric power in Uganda per year, separated by financing type" +#| column: page +totals = df.loc[ + ((df['SECTOR'] == 23630) | (df['SECTOR'] == 23631)) & # Total + (df['CHANNEL'] == 100) & + (df['AMOUNTTYPE'] == 'D') & + ((df['FLOW'] == 11) | (df['FLOW'] == 13)) & # Total + (df['FLOWTYPE'] == 112) & + (df['AIDTYPE'] == "100") # contains mixed int and string representations + ] +electricityaid = totals[totals['DONOR'] < 20000] # drop all 'total' aggregations + +pd.options.display.float_format = "{:.2f}".format + +el_grouped = electricityaid.groupby(['Year', 'Flow']).agg({'Value': ['sum']}) +el_grouped.style.format(escape="latex") +el_grouped +``` + +Note: Values shown are for all Official Development Assistance flows valid under the OECD CRS data, split into the type of financing flow, calculated as constant currency (2020 corrected) USD millions. The category under analysis is Electric Power transmission and distribution (centralized grids) within the data. +Source: Author's elaboration based on OECD ODA CRS (2022). + {{< pagebreak >}} diff --git a/_drivers-of-inequality-vietnam.qmd b/_drivers-of-inequality-vietnam.qmd index c825269..f808602 100644 --- a/_drivers-of-inequality-vietnam.qmd +++ b/_drivers-of-inequality-vietnam.qmd @@ -166,4 +166,95 @@ both ethnic minorities and the rural female population are thus at risk of being * Wordings do not quite capture quintile poverty assessments for coming descriptive statistics --> + +### Development assistance to Vietnam + +```{python} +# Load CRS data +dfsub1 = pd.read_csv('data/raw/OECD_CRS/CRS1_Vietnam_11-13_05092022215007164.csv', parse_dates=True, low_memory=False) +dfsub2 = pd.read_csv('data/raw/OECD_CRS/CRS1_Vietnam_14-16_05092022215226180.csv', parse_dates=True, low_memory=False) +dfsub3 = pd.read_csv('data/raw/OECD_CRS/CRS1_Vietnam_17-20_05092022215427555.csv', parse_dates=True, low_memory=False) +df = pd.concat([dfsub1, dfsub2, dfsub3], ignore_index=True) +df = df.rename(columns={'\ufeff"DONOR"': 'DONOR'}) +``` + +```{python} +#| label: fig-vnm-aid-financetype +#| fig-cap: "Total ODA for Vietnam per year, by financing type" +#| column: page +totals = df.loc[ + (df['SECTOR'] == 1000) & # Total + (df['CHANNEL'] == 100) & + (df['AMOUNTTYPE'] == 'D') & + (df['FLOWTYPE'] == 112) & + (df['AIDTYPE'] == "100") # contains mixed int and string representations + ] +financetotals = totals.copy() +financetotals = financetotals[financetotals['DONOR'] < 20000] # drop all 'total' aggregations + +## count amount of development aid financing instruments (grants/loans) by year and display +## count USD amount of development aid financing instumrnets by year and display +financetotals_grouped = financetotals.groupby(['Flow', 'Year']).agg({'Value': ['sum']}) +financetotals_grouped = financetotals_grouped.reset_index(['Flow', 'Year']) +financetotals_grouped.columns = financetotals_grouped.columns.to_flat_index() +financetotals_grouped.columns = ['Financetype', 'Year', 'Value'] + +fig = px.line(financetotals_grouped, x='Year', y='Value', color='Financetype', labels={"Value": "Development aid, in millions"}, markers=True, template="seaborn") +fig.show() +``` + +Note: Values shown are for all Official Development Assistance flows valid under the OECD CRS data, split into the type of financing flow, calculated as constant currency (2020 corrected) USD millions. +Source: Author's elaboration based on OECD ODA CRS (2022). + +```{python} +#| label: fig-vnm-aid-donortype +#| fig-cap: "Total ODA for Vietnam per year, separated by donor type" +#| column: page +totals = df.loc[ + (df['SECTOR'] == 1000) & # Total + (df['FLOW'] == 100) & + (df['CHANNEL'] == 100) & + (df['AMOUNTTYPE'] == 'D') & + (df['FLOWTYPE'] == 112) & + (df['AIDTYPE'] == "100") # contains mixed int and string representations + ] +donortotals = totals.copy() +donortotals["Donortype"] = donortotals["DONOR"].map(donortypes) +donortotals = donortotals[(donortotals["Donortype"] != "nondac")] + +donortotals_grouped = donortotals.groupby(['Donortype', 'Year']).agg({'Value': ['sum']}) +donortotals_grouped = donortotals_grouped.reset_index(['Donortype', 'Year']) +donortotals_grouped.columns = donortotals_grouped.columns.to_flat_index() +donortotals_grouped.columns = ['Donortype', 'Year', 'Value'] +fig = px.line(donortotals_grouped, x='Year', y='Value', color='Donortype', labels={"Value": "Development aid, in millions"}, markers=True, template="seaborn") +fig.show() +``` + +Note: Values shown are for all Official Development Assistance flows valid under the OECD ODA data, split into bilateral development donor countries (dac), bilateral non-DAC countries (nondac) and multilateral donors (multilateral), as constant currency (2020 corrected) USD millions. +Source: Author's elaboration based on OECD ODA CRS (2022). + +```{python} +#| label: tbl-vnm-aid-electricity +#| tbl-cap: "ODA for transmission and distribution of electric power in Vietnam per year, separated by financing type" +#| column: page +totals = df.loc[ + ((df['SECTOR'] == 23630) | (df['SECTOR'] == 23631)) & # Total + (df['CHANNEL'] == 100) & + (df['AMOUNTTYPE'] == 'D') & + ((df['FLOW'] == 11) | (df['FLOW'] == 13)) & # Total + (df['FLOWTYPE'] == 112) & + (df['AIDTYPE'] == "100") # contains mixed int and string representations + ] +electricityaid = totals[totals['DONOR'] < 20000] # drop all 'total' aggregations + +pd.options.display.float_format = "{:.2f}".format + +el_grouped = electricityaid.groupby(['Year', 'Flow']).agg({'Value': ['sum']}) +el_grouped.style.format(escape="latex") +el_grouped +``` + +Note: Values shown are for all Official Development Assistance flows valid under the OECD CRS data, split into the type of financing flow, calculated as constant currency (2020 corrected) USD millions. The category under analysis is Electric Power transmission and distribution (centralized grids) within the data. +Source: Author's elaboration based on OECD ODA CRS (2022). + {{< pagebreak >}}