19067
19067
}
19068
19068
],
19069
19069
"source": [
19070
- "def tableOut(Threshold, Country ):\n",
19070
+ "def tableOut(threshold, country ):\n",
19071
19071
"\n",
19072
- " df = search(Threshold , col_country, Country )\n",
19072
+ " df = search(threshold , col_country, country )\n",
19073
19073
" if df.empty:\n",
19074
19074
" return print(\"No indicators have been found.\")\n",
19075
19075
" \n",
@@ -19088,10 +19088,10 @@
19088
19088
"\n",
19089
19089
"\n",
19090
19090
"@interact(\n",
19091
- " Country = sorted(corr_df.index.tolist()),\n",
19092
- " Threshold = (0, 1, 0.05))\n",
19093
- "def g(Country = 'Afghanistan', Threshold = 0.7):\n",
19094
- " return tableOut(Threshold,Country )"
19091
+ " country = sorted(corr_df.index.tolist()),\n",
19092
+ " threshold = (0, 1, 0.05))\n",
19093
+ "def g(country = 'Afghanistan', threshold = 0.7):\n",
19094
+ " return tableOut(threshold ,country )"
19095
19095
]
19096
19096
},
19097
19097
{
19134
19134
}
19135
19135
],
19136
19136
"source": [
19137
- "def tableRegAgg(Threshold, Region ):\n",
19137
+ "def tableRegAgg(threshold, region ):\n",
19138
19138
"\n",
19139
- " df = search(Threshold , col_region, Region )\n",
19139
+ " df = search(threshold , col_region, region )\n",
19140
19140
" if df.empty:\n",
19141
19141
" return print(\"No indicators have been found.\")\n",
19142
19142
"\n",
@@ -19154,10 +19154,10 @@
19154
19154
"\n",
19155
19155
"\n",
19156
19156
"@interact(\n",
19157
- " Region = region_list,\n",
19158
- " Threshold = (0, 1, 0.05))\n",
19159
- "def g(Region = region_list[0], Threshold = 0.7):\n",
19160
- " return tableRegAgg(Threshold, Region )\n"
19157
+ " region = region_list,\n",
19158
+ " threshold = (0, 1, 0.05))\n",
19159
+ "def g(region = region_list[0], threshold = 0.7):\n",
19160
+ " return tableRegAgg(threshold, region )\n"
19161
19161
]
19162
19162
},
19163
19163
{
@@ -19191,13 +19191,13 @@
19191
19191
"median_corr_df_pearson_region = pd.merge(corr_df_pearson, region_df, how = 'inner', left_index = True, right_index = True).groupby(level = col_region).median()\n",
19192
19192
"median_corr_df_spearman_region = pd.merge(corr_df_spearman, region_df, how = 'inner', left_index = True, right_index = True).groupby(level = col_region).median()\n",
19193
19193
"\n",
19194
- "def tableRegMed(Region, Threshold ): \n",
19195
- " median_corr_series_pearson_region = median_corr_df_pearson_region.loc[Region ]\n",
19194
+ "def tableRegMed(region, threshold ): \n",
19195
+ " median_corr_series_pearson_region = median_corr_df_pearson_region.loc[region ]\n",
19196
19196
" median_corr_series_pearson_region.name = 'GDP Pearson Corr'\n",
19197
- " median_corr_series_spearman_region = median_corr_df_spearman_region.loc[Region ]\n",
19197
+ " median_corr_series_spearman_region = median_corr_df_spearman_region.loc[region ]\n",
19198
19198
" median_corr_series_spearman_region.name = 'GDP Spearman Corr'\n",
19199
19199
" df = pd.concat([median_corr_series_pearson_region, median_corr_series_spearman_region], axis = 1)\n",
19200
- " df = df.loc[(abs(df['GDP Pearson Corr']) >= Threshold ) & (abs(df['GDP Spearman Corr']) >= Threshold )]\n",
19200
+ " df = df.loc[(abs(df['GDP Pearson Corr']) >= threshold ) & (abs(df['GDP Spearman Corr']) >= threshold )]\n",
19201
19201
"\n",
19202
19202
" if df.empty:\n",
19203
19203
" return print(\"No indicators have been found.\")\n",
@@ -19216,10 +19216,10 @@
19216
19216
"\n",
19217
19217
"\n",
19218
19218
"@interact(\n",
19219
- " Region = region_list,\n",
19220
- " Threshold = (0, 1, 0.05))\n",
19221
- "def g(Region = region_list[0], Threshold = 0.7):\n",
19222
- " return tableRegMed(Region, Threshold )\n"
19219
+ " region = region_list,\n",
19220
+ " threshold = (0, 1, 0.05))\n",
19221
+ "def g(region = region_list[0], threshold = 0.7):\n",
19222
+ " return tableRegMed(region, threshold )\n"
19223
19223
]
19224
19224
},
19225
19225
{
19260
19260
}
19261
19261
],
19262
19262
"source": [
19263
- "def tableWorldAgg(Threshold ):\n",
19263
+ "def tableWorldAgg(threshold ):\n",
19264
19264
"\n",
19265
- " df = search(Threshold , 'Global')\n",
19265
+ " df = search(threshold , 'Global')\n",
19266
19266
" if df.empty:\n",
19267
19267
" return print(\"No indicators have been found.\")\n",
19268
19268
"\n",
19280
19280
"\n",
19281
19281
"\n",
19282
19282
"@interact(\n",
19283
- " Threshold = (0, 1, 0.05))\n",
19284
- "def g(Threshold = 0.7):\n",
19285
- " return tableWorldAgg(Threshold )\n"
19283
+ " threshold = (0, 1, 0.05))\n",
19284
+ "def g(threshold = 0.7):\n",
19285
+ " return tableWorldAgg(threshold )\n"
19286
19286
]
19287
19287
},
19288
19288
{
19316
19316
"median_corr_df_pearson = pd.merge(corr_df_pearson, region_df, how = 'inner', left_index = True, right_index = True).median().rename('GDP Pearson Corr')\n",
19317
19317
"median_corr_df_spearman = pd.merge(corr_df_spearman, region_df, how = 'inner', left_index = True, right_index = True).median().rename('GDP Spearman Corr')\n",
19318
19318
"\n",
19319
- "def tableWorldMed(Threshold ):\n",
19319
+ "def tableWorldMed(threshold ):\n",
19320
19320
" df = pd.concat([median_corr_df_pearson, median_corr_df_spearman], axis = 1)\n",
19321
- " df = df.loc[(abs(df['GDP Pearson Corr']) >= Threshold ) & (abs(df['GDP Spearman Corr']) >= Threshold )]\n",
19321
+ " df = df.loc[(abs(df['GDP Pearson Corr']) >= threshold ) & (abs(df['GDP Spearman Corr']) >= threshold )]\n",
19322
19322
"\n",
19323
19323
" if df.empty:\n",
19324
19324
" return print(\"No indicators have been found.\")\n",
19336
19336
"\n",
19337
19337
"\n",
19338
19338
"@interact(\n",
19339
- " Threshold = (0, 1, 0.05))\n",
19340
- "def g(Threshold = 0.7):\n",
19341
- " return tableWorldMed(Threshold )"
19339
+ " threshold = (0, 1, 0.05))\n",
19340
+ "def g(threshold = 0.7):\n",
19341
+ " return tableWorldMed(threshold )"
19342
19342
]
19343
19343
}
19344
19344
],
0 commit comments