def test_column(self): """A column can be constructed with no data.""" c = Column('foo') self.assertEqual(list(c), [])
def test_column_data(self): """A column can be constructed with initial data.""" c = Column('foo', range(3)) self.assertEqual(list(c), [0, 1, 2])
def test_column_type(self): """A column can be constructed specifying a type.""" c = Column('foo', range(3), column_type=int) self.assertEqual(list(c), [0, 1, 2])
def setUp(self): input_col = Column(self.expected_name, [-1, 0, 1], column_type=float) self.col = StandardizedColumn(column=input_col, deviation=1.0)
def setUp(self): input_col = Column(self.expected_name, [0, 0.5, 1], column_type=float) self.col = NormalizedColumn(column=input_col, normal=1.0)
def setUp(self): input_col = Column(self.expected_name, ["A", "B", "C"], column_type=str) self.col = DerivedTableColumn(column=input_col, indices_func=lambda: range(3))
def setUp(self): input_col = Column("xxx", ["A", "B", "C"], column_type=str) self.col = DerivedColumn(name=self.expected_name, inputs=[input_col], column_type=str, func=lambda *c: "X" + "".join(c))
def setUp(self): self.col = Column(self.expected_name, ["A", "B", "C"], column_type=str)