adding method SymptomHistogramByBatchcodeTableFactory.createGlobalSymptomHistogramByBatchcodeTable()

This commit is contained in:
frankknoll
2023-02-10 09:52:39 +01:00
parent 41524ed839
commit 206b2a6649
2 changed files with 34 additions and 0 deletions

View File

@@ -8,3 +8,10 @@ class SymptomHistogramByBatchcodeTableFactory:
.to_frame(name = 'SYMPTOM_COUNT_BY_VAX_LOT')
.reset_index(level = 'COUNTRY')
[['SYMPTOM_COUNT_BY_VAX_LOT', 'COUNTRY']])
@staticmethod
def createGlobalSymptomHistogramByBatchcodeTable(symptomByBatchcodeTable):
return (symptomByBatchcodeTable
.groupby(symptomByBatchcodeTable.index.names)
['SYMPTOM'].value_counts()
.to_frame(name = 'SYMPTOM_COUNT_BY_VAX_LOT'))