getDateRangeOfVAERSReportsBeforeDeletionOfCountryCodes()

This commit is contained in:
frankknoll
2023-06-11 11:04:02 +02:00
parent 2b1e501600
commit 39f532a385
5 changed files with 719 additions and 475 deletions

View File

@@ -10,13 +10,17 @@ def getCountryCountsByBatchcodeTable():
def _getCountryCountsByBatchcodeBeforeDeletion():
internationalVaersCovid19 = getInternationalVaersCovid19(dataDir = 'VAERS/VAERSBeforeDeletion', years = [2020, 2021, 2022])
internationalVaersCovid19 = _getInternationalVaersCovid19BeforeDeletion()
return (internationalVaersCovid19
.groupby('VAX_LOT')
['COUNTRY'].value_counts()
.to_frame(name = 'COUNTRY_COUNT_BY_VAX_LOT'))
def _getInternationalVaersCovid19BeforeDeletion():
return getInternationalVaersCovid19(dataDir = 'VAERS/VAERSBeforeDeletion', years = [2020, 2021, 2022])
def _combineCountryCountsByBatchcodeTables(countryCountsByClickedBatchcode, countryCountsByBatchcodeBeforeDeletion):
countryCountsByBatchcode = pd.merge(
countryCountsByClickedBatchcode,
@@ -31,5 +35,10 @@ def _combineCountryCountsByBatchcodeTables(countryCountsByClickedBatchcode, coun
return countryCountsByBatchcode
def getDateRangeOfVAERSReportsBeforeDeletionOfCountryCodes():
dates = _getInternationalVaersCovid19BeforeDeletion()['RECVDATE']
return dates.min(), dates.max()
def filterByBatchcodes(countryCountsByBatchcode, batchcodes2Retain):
return countryCountsByBatchcode.loc[(batchcodes2Retain, slice(None)), :]

View File

@@ -221,10 +221,12 @@
"outputs": [],
"source": [
"from GoogleAnalyticsReader import GoogleAnalyticsReader\n",
"from CountriesByBatchcodeProvider import getDateRangeOfVAERSReportsBeforeDeletionOfCountryCodes\n",
"\n",
"dateRange = GoogleAnalyticsReader(dataDir = 'data/GoogleAnalytics').getDateRange()\n",
"barChartDescriptions = {\n",
" 'dateRange guessed': dateRange2Str(dateRange),\n",
" 'dateRange before deletion': dateRange2Str(getDateRangeOfVAERSReportsBeforeDeletionOfCountryCodes()),\n",
" 'barChartDescriptions': barChartDescriptionTable['BAR_CHART_DESCRIPTION'].to_dict()\n",
"}\n"
]