示例#1
0
    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())
示例#2
0
    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())
示例#3
0
 def __init__(self, year):
     """
     Constructor
     """
     self.year = year
     self.df = merge_by_year(year)
示例#4
0
 def __init__(self, year):
     '''
     Constructor
     '''
     self.year = year
     self.df = merge_by_year(year)