merging
This commit is contained in:
@@ -6,11 +6,9 @@ class BatchCodeTableFactory:
|
||||
|
||||
def __init__(self, dataFrame: pd.DataFrame):
|
||||
self.dataFrame = dataFrame
|
||||
self.companyColumnAdder = CompanyColumnAdder(dataFrame)
|
||||
self.countryBatchCodeTable = SummationTableFactory.createSummationTable(dataFrame.groupby(['COUNTRY', 'VAX_LOT']))
|
||||
|
||||
def createGlobalBatchCodeTable(self, countriesAsList = False):
|
||||
return self._postProcess(SummationTableFactory.createSummationTable(self.dataFrame.groupby('VAX_LOT')), countriesAsList)
|
||||
|
||||
def createGlobalBatchCodeTable(self):
|
||||
return self._postProcess(SummationTableFactory.createSummationTable(self.dataFrame.groupby('VAX_LOT')))
|
||||
|
||||
def createBatchCodeTableByCountry(self, country):
|
||||
return self._postProcess(self._getBatchCodeTableByCountry(country))
|
||||
@@ -37,4 +35,4 @@ class BatchCodeTableFactory:
|
||||
return SummationTableFactory.createSummationTable(self.dataFrame.groupby(['COUNTRY', 'VAX_LOT']))
|
||||
|
||||
def _getEmptyBatchCodeTable(self, countryBatchCodeTable):
|
||||
return countryBatchCodeTable[0:0].droplevel(0)
|
||||
return countryBatchCodeTable[0:0].droplevel(0)
|
||||
@@ -17,5 +17,5 @@ class CountryCountsByBatchcodeTablesMerger:
|
||||
|
||||
@staticmethod
|
||||
def _getTables():
|
||||
files = glob.glob(r'data/*')
|
||||
files = glob.glob(r'data/GoogleAnalytics/*')
|
||||
return [CountryCountsByClickedBatchcodeProvider.getCountryCountsByClickedBatchcode(file) for file in files]
|
||||
|
||||
@@ -16,14 +16,16 @@
|
||||
"from IOUtils import IOUtils\n",
|
||||
"from VAERSFileDownloader import updateVAERSFiles\n",
|
||||
"from datetime import datetime\n",
|
||||
"from DateProvider import DateProvider\n",
|
||||
"from InternationalVaersCovid19Provider import getInternationalVaersCovid19, get_international_VAERSVAX_VAERSSYMPTOMS_Covid19\n",
|
||||
"from BatchCodeTableHtmlUpdater import updateBatchCodeTableHtmlFile, saveLastUpdatedBatchCodeTable\n",
|
||||
"from BatchCodeTablePersister import createGlobalBatchCodeTable\n",
|
||||
"from SymptomByBatchcodeTableFactory import SymptomByBatchcodeTableFactory\n",
|
||||
"from HistogramFactoryAndPersister import createAndSaveGlobalHistograms\n",
|
||||
"from BatchCodeTableFactory import BatchCodeTableFactory\n",
|
||||
"from BatchCodeTableHavingGuessedCountriesFactory import BatchCodeTableHavingGuessedCountriesFactory\n",
|
||||
"from CountriesByBatchcodeProvider import getCountryCountsByBatchcodeTable\n"
|
||||
"from Column2DataframeAdder import addColumn2Dataframe\n",
|
||||
"from CountriesByBatchcodeProvider import getCountryCountsByBatchcodeTable\n",
|
||||
"from CountryCountsByBatchcodeTable2BarChartDescriptionTableConverter import CountryCountsByBatchcodeTable2BarChartDescriptionTableConverter\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -36,6 +38,20 @@
|
||||
"print(datetime.now().strftime(\"%d.%m.%Y, %H:%M:%S Uhr\"))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "ffad1c04",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"dateProvider = DateProvider()\n",
|
||||
"print(' lastUpdated:', dateProvider.getLastUpdated())\n",
|
||||
"print('lastUpdatedDataSource:', dateProvider.getLastUpdatedDataSource())\n",
|
||||
"needsUpdate = dateProvider.needsUpdate()\n",
|
||||
"print('needsUpdate:', needsUpdate)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
@@ -162,7 +178,7 @@
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "d6c2b650",
|
||||
"id": "9588a10c",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -173,7 +189,47 @@
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "29df3cfc",
|
||||
"id": "70fcc420",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"countryCountsByBatchcode.to_excel('tmp/countryCountsByBatchcode.xlsx')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "7a67b1f6",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"barChartDescriptionTable = CountryCountsByBatchcodeTable2BarChartDescriptionTableConverter.convert2BarChartDescriptionTable(countryCountsByBatchcode)\n",
|
||||
"barChartDescriptionTable"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "8e1b471a",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"barChartDescriptionTable['BAR_CHART_DESCRIPTION'].to_json('../docs/data/barChartDescriptionTable.json')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"id": "2d93b511",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Vaccine Distribution by Zipcode"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "cfcbad44",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -187,20 +243,20 @@
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "cf55ee83",
|
||||
"id": "59c745d2",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from CountryCountsByBatchcodeTable2BarChartDescriptionTableConverter import CountryCountsByBatchcodeTable2BarChartDescriptionTableConverter\n",
|
||||
"from VaccineDistributionByZipcodeSimplifier import VaccineDistributionByZipcodeSimplifier\n",
|
||||
"\n",
|
||||
"barChartDescriptionTable = CountryCountsByBatchcodeTable2BarChartDescriptionTableConverter.convert2BarChartDescriptionTable(countryCountsByBatchcode)\n",
|
||||
"barChartDescriptionTable"
|
||||
"vaccineDistributionByZipcode = VaccineDistributionByZipcodeSimplifier.sumDoses(vaccineDistributionByZipcode)\n",
|
||||
"vaccineDistributionByZipcode"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "ce1b2189",
|
||||
"id": "8cd250f7",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
||||
Reference in New Issue
Block a user