Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6404d1d

Browse files
committed
removes checking truth value of an array with more than one element
1 parent 6eeea3f commit 6404d1d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

learning.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ def __init__(self, examples=None, attrs=None, attrnames=None, target=-1,
8484
else:
8585
self.examples = examples
8686
# Attrs are the indices of examples, unless otherwise stated.
87-
if not attrs and self.examples:
88-
attrs = list(range(len(self.examples[0])))
87+
if attrs is None and self.examples is not None:
88+
attrs = list(range(len(self.examples[0])))
8989
self.attrs = attrs
9090
# Initialize .attrnames from string, list, or by default
9191
if isinstance(attrnames, str):

0 commit comments

Comments
 (0)