def test_remove_column(self):
     """remove one column"""
     df = pandas.DataFrame([[0.001, -0.35], [np.nan, 0.42]], ['R1', 'R2'], ['C1', 'C2'])
     filtered = dm.nochange_filter(df)
     self.assertEquals(2, filtered.shape[0])
     self.assertEquals(1, filtered.shape[1])
     self.assertTrue((filtered.values == [[-0.35], [0.42]]).all())
示例#2
0
 def test_remove_column(self):
     """remove one column"""
     df = pandas.DataFrame([[0.001, -0.35], [np.nan, 0.42]], ['R1', 'R2'], ['C1', 'C2'])
     filtered = dm.nochange_filter(df)
     self.assertEquals(2, filtered.shape[0])
     self.assertEquals(1, filtered.shape[1])
     self.assertTrue((filtered.values == [[-0.35], [0.42]]).all())
 def test_simple(self):
     """simplest test case: everything kept"""
     df = pandas.DataFrame(np.array([[0.24, -0.35], [-0.42, 0.42]]), ['R1', 'R2'], ['C1', 'C2'])
     filtered = dm.nochange_filter(df)
     self.assertEquals(2, filtered.shape[0])
     self.assertEquals(2, filtered.shape[1])
     self.assertTrue((filtered.values == [[0.24, -0.35],
                                            [-0.42, 0.42]]).all())
示例#4
0
 def test_simple(self):
     """simplest test case: everything kept"""
     df = pandas.DataFrame(np.array([[0.24, -0.35], [-0.42, 0.42]]), ['R1', 'R2'], ['C1', 'C2'])
     filtered = dm.nochange_filter(df)
     self.assertEquals(2, filtered.shape[0])
     self.assertEquals(2, filtered.shape[1])
     self.assertTrue((filtered.values == [[0.24, -0.35],
                                            [-0.42, 0.42]]).all())
示例#5
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())
示例#6
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())
示例#7
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())
示例#8
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())