updating Countries column

This commit is contained in:
frankknoll
2023-04-02 10:37:19 +02:00
parent 0d55399a87
commit f76e3909f9
1028 changed files with 1124 additions and 1254 deletions

View File

@@ -22,8 +22,7 @@ class BatchCodeTableFactory:
def _postProcess(self, batchCodeTable, countriesAsList):
batchCodeTable = self.companyColumnAdder.addCompanyColumn(batchCodeTable)
if not countriesAsList:
batchCodeTable['Countries'] = batchCodeTable['Countries'].apply(', '.join)
BatchCodeTableFactory._convertCountries(batchCodeTable, countriesAsList)
batchCodeTable = batchCodeTable[
[
'Adverse Reaction Reports',
@@ -37,6 +36,11 @@ class BatchCodeTableFactory:
]]
return batchCodeTable.sort_values(by = 'Severe reports', ascending = False)
@staticmethod
def _convertCountries(batchCodeTable, countriesAsList):
if not countriesAsList:
batchCodeTable['Countries'] = batchCodeTable['Countries'].apply(', '.join)
def _getBatchCodeTableByCountry(self, country):
if country in self.countryBatchCodeTable.index:
return self.countryBatchCodeTable.loc[country]