Skip to content

Commit

Permalink
removes checking truth value of an array with more than one element
Browse files Browse the repository at this point in the history
  • Loading branch information
SnShine committed Jul 15, 2016
1 parent 6eeea3f commit 6404d1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions learning.py
Expand Up @@ -84,8 +84,8 @@ def __init__(self, examples=None, attrs=None, attrnames=None, target=-1,
else:
self.examples = examples
# Attrs are the indices of examples, unless otherwise stated.
if not attrs and self.examples:
attrs = list(range(len(self.examples[0])))
if attrs is None and self.examples is not None:
attrs = list(range(len(self.examples[0])))
self.attrs = attrs
# Initialize .attrnames from string, list, or by default
if isinstance(attrnames, str):
Expand Down

0 comments on commit 6404d1d

Please sign in to comment.