def test_filter_onefilter_function(self): dataf = dplyr.DataFrame(mtcars) ngear_gt_3 = len(tuple(x for x in dataf.rx2('gear') if x > 3)) dataf_filter = dplyr.filter(dataf, 'gear > 3') assert ngear_gt_3 == dataf_filter.nrow
def test_filter_nofilter_function(self): dataf = dplyr.DataFrame(mtcars) dataf_filter = dplyr.filter(dataf) assert dataf.nrow == dataf_filter.nrow
def testFilter_NoFilter_Function(self): dataf = dplyr.DataFrame(mtcars) dataf_filter = dplyr.filter(dataf) self.assertEqual(dataf.nrow, dataf_filter.nrow)
def testFilter_OneFilter_Function(self): dataf = dplyr.DataFrame(mtcars) ngear_gt_3 = len(tuple(x for x in dataf.rx2('gear') if x > 3)) dataf_filter = dplyr.filter(dataf, 'gear > 3') self.assertEqual(ngear_gt_3, dataf_filter.nrow)
def testFunction_filter(self): self.DataFrame = self.DataFrame dataf_a = self.DataFrame({'x': IntVector((1, 2, 3))}) dataf_af = dplyr.filter(dataf_a, 'x < 2') self.assertEqual(1, dataf_af.collect().nrow)