def test_outer(self): df3 = Table.merge(df1, df2, ['type', 'size'], 'outer') self.assertEqual(df3.rowcnt, cnt_inner+cnt_left+cnt_right) self.assertEqual(df3.columns, ['type', 'size', 'weight', 'tel', 'cost']) self.assertEqual(df3.nunique()[1].sum(), 23) self.assertEqual(df3['weight'].sum(), 74)
def test_inner(self): df3 = Table.merge(df1, df2, ['type', 'size'], 'inner') self.assertEqual(df3.rowcnt, cnt_inner) self.assertEqual(df3.columns, ['type', 'size', 'weight', 'tel', 'cost']) self.assertEqual(df3.nunique()[1].sum(), 13) self.assertEqual(df3['weight'].sum(), 34)