adding function getCountriesByClickedBatchcode()
This commit is contained in:
@@ -21,5 +21,6 @@ class BatchCodeTableHavingGuessedCountriesFactory:
|
|||||||
def _guessCountries(self, batchCodeTable, countriesAsList):
|
def _guessCountries(self, batchCodeTable, countriesAsList):
|
||||||
batchCodeTable['Countries'] = CountriesMerger.mergeSrcIntoDst(
|
batchCodeTable['Countries'] = CountriesMerger.mergeSrcIntoDst(
|
||||||
dst = batchCodeTable['Countries'],
|
dst = batchCodeTable['Countries'],
|
||||||
|
# FK-TODO: zusätzlich zu self.countriesByBatchcodeBeforeDeletion auch noch mit dem Ergebnis der noch zu implementierenden Funktion CountriesByBatchcodeProvider.getCountriesByClickedBatchcode() mergen.
|
||||||
src = self.countriesByBatchcodeBeforeDeletion['Countries'])
|
src = self.countriesByBatchcodeBeforeDeletion['Countries'])
|
||||||
BatchCodeTableFactory._convertCountries(batchCodeTable, countriesAsList)
|
BatchCodeTableFactory._convertCountries(batchCodeTable, countriesAsList)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import pandas as pd
|
import pandas as pd
|
||||||
from BatchCodeTableFactory import BatchCodeTableFactory
|
from BatchCodeTableFactory import BatchCodeTableFactory
|
||||||
from InternationalVaersCovid19Provider import getInternationalVaersCovid19
|
from InternationalVaersCovid19Provider import getInternationalVaersCovid19
|
||||||
|
from SummationTableFactory import SummationTableFactory
|
||||||
|
|
||||||
|
|
||||||
def getCountryCountsByBatchcodeTable():
|
def getCountryCountsByBatchcodeTable():
|
||||||
@@ -45,6 +46,17 @@ def _combineCountryCountsByBatchcodeTables(countryCountsByClickedBatchcode, coun
|
|||||||
return countryCountsByBatchcode
|
return countryCountsByBatchcode
|
||||||
|
|
||||||
|
|
||||||
|
def getCountriesByClickedBatchcode():
|
||||||
|
return (_getCountryCountsByClickedBatchcode()
|
||||||
|
.reset_index(level = 'COUNTRY')
|
||||||
|
.groupby('VAX_LOT')
|
||||||
|
.agg(
|
||||||
|
Countries =
|
||||||
|
pd.NamedAgg(
|
||||||
|
column = 'COUNTRY',
|
||||||
|
aggfunc = SummationTableFactory.sortCountries)))
|
||||||
|
|
||||||
|
|
||||||
def getCountriesByBatchcodeBeforeDeletion():
|
def getCountriesByBatchcodeBeforeDeletion():
|
||||||
internationalVaersCovid19 = getInternationalVaersCovid19(dataDir = 'VAERS/VAERSBeforeDeletion', years = [2020, 2021, 2022])
|
internationalVaersCovid19 = getInternationalVaersCovid19(dataDir = 'VAERS/VAERSBeforeDeletion', years = [2020, 2021, 2022])
|
||||||
batchCodeTable = BatchCodeTableFactory(internationalVaersCovid19).createGlobalBatchCodeTable(countriesAsList = True)
|
batchCodeTable = BatchCodeTableFactory(internationalVaersCovid19).createGlobalBatchCodeTable(countriesAsList = True)
|
||||||
|
|||||||
Reference in New Issue
Block a user