def test_merge(self): """ Test merge function Exhaustively for every country at year 2000. And repeat the test 10 times. """ for count in range(10): year = 2000 income_yr = pd.DataFrame(income.ix[year]).astype(float) merged = merge_by_year(year) for country in merged["Country"]: bool = merged["Country"] == country self.assertTrue((merged[bool]["Income"] == income_yr.ix[country]).all())
def test_merge(self): ''' Test merge function Exhaustively for every country at year 2000. And repeat the test 10 times. ''' for count in range(10): year = 2000 income_yr = pd.DataFrame(income.ix[year]).astype(float) merged = merge_by_year(year) for country in merged['Country']: bool = (merged['Country'] == country) self.assertTrue( (merged[bool]['Income'] == income_yr.ix[country]).all())
def __init__(self, year): """ Constructor """ self.year = year self.df = merge_by_year(year)
def __init__(self, year): ''' Constructor ''' self.year = year self.df = merge_by_year(year)