refactoring
This commit is contained in:
@@ -4,12 +4,12 @@ class CountryColumnAdder:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def addCountryColumn(dataFrame):
|
def addCountryColumn(dataFrame):
|
||||||
dataFrame['COUNTRY'] = CountryColumnAdder._getCountryColumn(dataFrame)
|
dataFrame['COUNTRY'] = CountryColumnAdder._splttype2Country(dataFrame['SPLTTYPE'])
|
||||||
return dataFrame
|
return dataFrame
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _getCountryColumn(dataFrame):
|
def _splttype2Country(splttypeSeries):
|
||||||
return (dataFrame['SPLTTYPE']
|
return (splttypeSeries
|
||||||
.apply(
|
.apply(
|
||||||
lambda splttype:
|
lambda splttype:
|
||||||
CountryColumnAdder._getCountryNameOfSplttypeOrDefault(
|
CountryColumnAdder._getCountryNameOfSplttypeOrDefault(
|
||||||
|
|||||||
Reference in New Issue
Block a user