refining SymptomHistogramByBatchcodeTableFactoryTest

This commit is contained in:
frankknoll
2023-02-08 11:26:01 +01:00
parent 408f523797
commit 197321b2da
3 changed files with 26 additions and 23 deletions

View File

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