sorting Countries column by Jensen-Shannon distance
This commit is contained in:
@@ -12,7 +12,6 @@
|
||||
"from CountriesByBatchcodeProvider import getCountryCountsByBatchcodeTable, filterByBatchcodes\n",
|
||||
"from Column2DataframeAdder import addColumn2Dataframe\n",
|
||||
"from BatchCodeTableFactory import BatchCodeTableFactory\n",
|
||||
"from BarChartDescriptionTables import BarChartDescriptionTables\n",
|
||||
"from HistogramFactoryAndPersister import createAndSaveGlobalHistograms\n",
|
||||
"from SymptomByBatchcodeTableFactory import SymptomByBatchcodeTableFactory\n",
|
||||
"from BatchCodeTablePersister import createGlobalBatchCodeTable\n",
|
||||
@@ -225,48 +224,6 @@
|
||||
"barChartDescriptionTable"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "39c83928",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"barChartDescriptionTable = BarChartDescriptionTables.filter(\n",
|
||||
" barChartDescriptionTable,\n",
|
||||
" lambda barChartDescription: (\n",
|
||||
" BarChartDescriptionTables.isValidJensenShannonDistance(barChartDescription)\n",
|
||||
" and BarChartDescriptionTables.hasMinSizeOfKnownHistogram(barChartDescription, 200)\n",
|
||||
" # and BarChartDescriptionTables.containsCountry(barChartDescription, 'Switzerland')\n",
|
||||
" and BarChartDescriptionTables.hasMinSizeOfGuessedHistogram(barChartDescription, 200)\n",
|
||||
" # and BarChartDescriptionTables.hasCountryWithGuessedGreaterThanKnown(barChartDescription)\n",
|
||||
" # and BarChartDescriptionTables.isGuessedGreaterThanKnown(barChartDescription)\n",
|
||||
" ))\n",
|
||||
"barChartDescriptionTable\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "123be407",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"batchcodes2Retain = barChartDescriptionTable.index.values\n",
|
||||
"batchCodeTable = batchCodeTable[batchCodeTable['Batch'].isin(batchcodes2Retain)]\n",
|
||||
"batchCodeTable"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "3bd5d78d",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"IOUtils.saveDataFrameAsJson(batchCodeTable, '../docs/data/batchCodeTables/Global.json')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
|
||||
Reference in New Issue
Block a user