python 2.6 compatibility tweak
replacing set literal {} with set() for python 2.6 compatibility (plus reformatting the line)
This commit is contained in:
parent
d1969b4c03
commit
8c7b18daed
@ -538,7 +538,8 @@ class DMatrix(object):
|
|||||||
msg = 'feature_names must have the same length as data'
|
msg = 'feature_names must have the same length as data'
|
||||||
raise ValueError(msg)
|
raise ValueError(msg)
|
||||||
# prohibit to use symbols may affect to parse. e.g. []<
|
# prohibit to use symbols may affect to parse. e.g. []<
|
||||||
if not all(isinstance(f, STRING_TYPES) and not any(x in f for x in {'[', ']', '<'})
|
if not all(isinstance(f, STRING_TYPES) and
|
||||||
|
not any(x in f for x in set(('[', ']', '<')))
|
||||||
for f in feature_names):
|
for f in feature_names):
|
||||||
raise ValueError('feature_names may not contain [, ] or <')
|
raise ValueError('feature_names may not contain [, ] or <')
|
||||||
else:
|
else:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user