Skip to content

Commit 182c416

Browse files
authored
Merge branch 'develop' into dependencies
2 parents 7228eeb + fa9f00f commit 182c416

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

openml/datasets/data_feature.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ class OpenMLDataFeature(object):
1616
"""
1717
LEGAL_DATA_TYPES = ['nominal', 'numeric', 'string', 'date']
1818

19-
def __init__(self, index, name, data_type, nominal_values, number_missing_values):
19+
def __init__(self, index, name, data_type, nominal_values,
20+
number_missing_values):
2021
if type(index) != int:
2122
raise ValueError('Index is of wrong datatype')
2223
if data_type not in self.LEGAL_DATA_TYPES:
23-
raise ValueError('data type should be in %s, found: %s' %(str(self.LEGAL_DATA_TYPES),data_type))
24+
raise ValueError('data type should be in %s, found: %s' %
25+
(str(self.LEGAL_DATA_TYPES), data_type))
2426
if nominal_values is not None and type(nominal_values) != list:
2527
raise ValueError('Nominal_values is of wrong datatype')
2628
if type(number_missing_values) != int:
@@ -33,4 +35,7 @@ def __init__(self, index, name, data_type, nominal_values, number_missing_values
3335
self.number_missing_values = number_missing_values
3436

3537
def __str__(self):
36-
return "[%d - %s (%s)]" %(self.index, self.name, self.data_type)
38+
return "[%d - %s (%s)]" % (self.index, self.name, self.data_type)
39+
40+
def _repr_pretty_(self, pp, cycle):
41+
pp.text(str(self))

0 commit comments

Comments
 (0)