Skip to content

Commit eb86ff8

Browse files
committed
Explain the -1 Python syntax.
1 parent bf5798e commit eb86ff8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

doc/tutorial/basic/tutorial.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ We call our estimator instance `clf` as it is a classifier. It now must
171171
be fitted to the model, that is, it must `learn` from the model. This is
172172
done by passing our training set to the ``fit`` method. As a training
173173
set, let us use all the images of our dataset apart from the last
174-
one::
174+
one. We select this training set with the ``[:-1]`` Python syntax,
175+
which produces a new array that contains all but
176+
the last entry of ``digits.data``::
175177

176178
>>> clf.fit(digits.data[:-1], digits.target[:-1]) # doctest: +NORMALIZE_WHITESPACE
177179
SVC(C=100.0, cache_size=200, class_weight=None, coef0=0.0, degree=3,

0 commit comments

Comments
 (0)