def test_defaults(self): counts = utils.groupby_and_aggregate(self.buildings, self.group_col, self.count_col, aggfxn=None) nt.assert_dict_equal(counts, self.known_counts)
def test_defaults(self): counts = utils.groupby_and_aggregate( self.buildings, self.group_col, self.count_col, aggfxn=None ) nt.assert_dict_equal(counts, self.known_counts)
def test_area(self): areadict = utils.groupby_and_aggregate( self.areas, self.group_col, self.area_op, aggfxn=lambda g: sum([row[1] for row in g])) for key in areadict.keys(): nt.assert_almost_equal(areadict[key], self.known_areas[key], delta=0.01)
def test_area(self): areadict = utils.groupby_and_aggregate( self.areas, self.group_col, self.area_op, aggfxn=lambda g: sum([row[1] for row in g]) ) for key in areadict.keys(): nt.assert_almost_equal( areadict[key], self.known_areas[key], delta=0.01 )
def test_bad_count_col(self): counts = utils.groupby_and_aggregate(self.buildings, self.group_col, "JUNK")
def test_bad_count_col(self): counts = utils.groupby_and_aggregate( self.buildings, self.group_col, "JUNK" )