Files
HowBadIsMyBatch/src/CountriesColumnAdder.py
frankknoll f44c0f8869 refactoring
2023-03-28 15:01:31 +02:00

9 lines
405 B
Python

class CountriesColumnAdder:
def addCountriesColumn(self, countriesByBatchcodeTable, columnName):
countriesByBatchcodeTable[columnName] = countriesByBatchcodeTable.apply(self._getCountriesHavingEvents, axis='columns')
return countriesByBatchcodeTable
def _getCountriesHavingEvents(self, eventCountByCountry):
return set(eventCountByCountry[eventCountByCountry > 0].index)