Files
HowBadIsMyBatch/src/CountryCountsByBatchcodeTable2BarChartDescriptionTableConverter.py
frankknoll 77a11b15d0 refactoring
2023-06-11 12:52:39 +02:00

18 lines
822 B
Python

class CountryCountsByBatchcodeTable2BarChartDescriptionTableConverter:
@staticmethod
def convert2BarChartDescriptionTable(countryCountsByBatchcodeTable):
return (countryCountsByBatchcodeTable
.reset_index(level = 'COUNTRY')
.rename(
columns =
{
'COUNTRY': 'countries',
'COUNTRY_COUNT_BY_VAX_LOT Clicked': 'Adverse Reaction Reports guessed',
'COUNTRY_COUNT_BY_VAX_LOT Before Deletion': 'Adverse Reaction Reports known'
})
.groupby('VAX_LOT')
.apply(lambda countryCountsTable: countryCountsTable.to_dict('list'))
.rename('BAR_CHART_DESCRIPTION')
.to_frame())