Columns with BasedReal conversions and truncatures
Enforce data homogeneity
class BasedColumn(Column):
def __init__(self, *args, **kwargs):
assert all(type(v) is type(args[0][0]) for v in args[0])
self.values_type = type(v)
def astype(self, dtype, *args, **kwargs):
if issubclass(dtype, BasedReal):
return np.vectorize(...)(self)
else:
return super().astype(dtype, *args, **kwargs)
def truncate(self, ...):
return np.vectorize(...)(self)