Exemplo n.º 1
0
 def test_simple(self):
     """simplest test case: everything kept"""
     matrix = dm.DataMatrix(2, 2, ["R1", "R2"], ["C1", "C2"], values=[[0.24, -0.35], [-0.42, 0.42]])
     filtered = dm.nochange_filter(matrix)
     self.assertEquals(2, filtered.num_rows())
     self.assertEquals(2, filtered.num_columns())
     self.assertTrue((filtered.values() == [[0.24, -0.35], [-0.42, 0.42]]).all())
Exemplo n.º 2
0
 def test_remove_column(self):
     """remove one column"""
     matrix = dm.DataMatrix(2, 2, ["R1", "R2"], ["C1", "C2"], values=[[0.001, -0.35], [np.nan, 0.42]])
     filtered = dm.nochange_filter(matrix)
     self.assertEquals(2, filtered.num_rows())
     self.assertEquals(1, filtered.num_columns())
     self.assertTrue((filtered.values() == [[-0.35], [0.42]]).all())
 def test_remove_column(self):
     """remove one column"""
     matrix = dm.DataMatrix(2, 2, ['R1', 'R2'], ['C1', 'C2'],
                            values=[[0.001, -0.35], [np.nan, 0.42]])
     filtered = dm.nochange_filter(matrix)
     self.assertEquals(2, filtered.num_rows)
     self.assertEquals(1, filtered.num_columns)
     self.assertTrue((filtered.values == [[-0.35], [0.42]]).all())
Exemplo n.º 4
0
 def test_remove_column(self):
     """remove one column"""
     matrix = dm.DataMatrix(2,
                            2, ['R1', 'R2'], ['C1', 'C2'],
                            values=[[0.001, -0.35], [np.nan, 0.42]])
     filtered = dm.nochange_filter(matrix)
     self.assertEquals(2, filtered.num_rows)
     self.assertEquals(1, filtered.num_columns)
     self.assertTrue((filtered.values == [[-0.35], [0.42]]).all())
Exemplo n.º 5
0
 def test_simple(self):
     """simplest test case: everything kept"""
     matrix = dm.DataMatrix(2,
                            2, ['R1', 'R2'], ['C1', 'C2'],
                            values=[[0.24, -0.35], [-0.42, 0.42]])
     filtered = dm.nochange_filter(matrix)
     self.assertEquals(2, filtered.num_rows)
     self.assertEquals(2, filtered.num_columns)
     self.assertTrue((filtered.values == [[0.24, -0.35], [-0.42,
                                                          0.42]]).all())