Skip to content

Commit edeeacc

Browse files
committed
MIN Match book exactly
The previous code was equivalent, but not equal to the book
1 parent b57108c commit edeeacc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ch02/simple_threshold.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@
1515

1616
plength = features[:, 2]
1717
is_setosa = (labels == 'setosa')
18-
print('Maximum of setosa: {0}.'.format(plength[is_setosa].max()))
19-
print('Minimum of others: {0}.'.format(plength[~is_setosa].min()))
18+
max_setosa = plength[is_setosa].max()
19+
min_non_setosa = plength[~is_setosa].min()
20+
21+
print('Maximum of setosa: {0}.'.format(max_setosa))
22+
print('Minimum of others: {0}.'.format(min_non_setosa))

0 commit comments

Comments
 (0)