change the print format for dataset and instance
@@ -300,6 +300,7 @@ from .field import FieldArray
from .field import SetInputOrTargetException
from .instance import Instance
from .utils import _get_func_signature
+from .utils import pretty_table_printer
class DataSet(object):
@@ -421,14 +422,8 @@ class DataSet(object):
field = iter(self.field_arrays.values()).__next__()
return len(field)
- def __inner_repr__(self):
- if len(self) < 20:
- return ",\n".join([ins.__repr__() for ins in self])
- else:
- return self[:5].__inner_repr__() + "\n...\n" + self[-5:].__inner_repr__()
-
def __repr__(self):
- return "DataSet(" + self.__inner_repr__() + ")"
+ return str(pretty_table_printer(self))
def append(self, instance):
"""
