adding test SymptomHistogramByBatchcodeTableFactoryTest.test_createSymptomHistogramByBatchcodeTable_two_VAX_LOTs_Index()

This commit is contained in:
frankknoll
2023-01-23 09:12:53 +01:00
parent dcdf1f9536
commit d8b55ce00a
2 changed files with 30 additions and 1 deletions

View File

@@ -2,4 +2,7 @@ class SymptomHistogramByBatchcodeTableFactory:
@staticmethod
def createSymptomHistogramByBatchcodeTable(symptomByBatchcodeTable):
return symptomByBatchcodeTable.groupby(['VAX_LOT1'])['SYMPTOM'].value_counts().to_frame('SYMPTOM_COUNT_BY_VAX_LOT')
return (symptomByBatchcodeTable
.groupby(symptomByBatchcodeTable.index.names)
['SYMPTOM'].value_counts()
.to_frame('SYMPTOM_COUNT_BY_VAX_LOT'))