// Expand k in to the values we will use, capturing exceptions
try:
k = tuple(k)
self.k_values_ = list(range(*k))
except:
raise YellowbrickValueError((
"Specify a range or maximal K value, the value "{}" "
After Change
self.k_values_ = list(range(*k))
elif isinstance(k, collections.Iterable) and \
all(isinstance(x, (int, np.integer)) for x in k):
self.k_values_ = list(k)
else:
raise YellowbrickValueError((
"Specify an iterable of integers, a range, or maximal K value,"
" the value "{}" is not a valid argument for K.".format(k)