adding function getCountriesByClickedBatchcode()

This commit is contained in:
frankknoll
2023-05-30 00:03:44 +02:00
parent 6d65921abc
commit cd4b21eda4
2 changed files with 13 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
import pandas as pd
from BatchCodeTableFactory import BatchCodeTableFactory
from InternationalVaersCovid19Provider import getInternationalVaersCovid19
from SummationTableFactory import SummationTableFactory
def getCountryCountsByBatchcodeTable():
@@ -45,6 +46,17 @@ def _combineCountryCountsByBatchcodeTables(countryCountsByClickedBatchcode, coun
return countryCountsByBatchcode
def getCountriesByClickedBatchcode():
return (_getCountryCountsByClickedBatchcode()
.reset_index(level = 'COUNTRY')
.groupby('VAX_LOT')
.agg(
Countries =
pd.NamedAgg(
column = 'COUNTRY',
aggfunc = SummationTableFactory.sortCountries)))
def getCountriesByBatchcodeBeforeDeletion():
internationalVaersCovid19 = getInternationalVaersCovid19(dataDir = 'VAERS/VAERSBeforeDeletion', years = [2020, 2021, 2022])
batchCodeTable = BatchCodeTableFactory(internationalVaersCovid19).createGlobalBatchCodeTable(countriesAsList = True)