This page

Citing

Please consider citing the scikit-learn.

9.19.1.3. sklearn.datasets.load_digits

sklearn.datasets.load_digits(n_class=10)

Load and return the digits dataset (classification).

Parameters :

n_class : integer, between 0 and 10, optional (default=10)

The number of classes to return.

Examples

To load the data and visualize the images:

>>> from sklearn.datasets import load_digits
>>> digits = load_digits()
>>> digits.data.shape

(1797, 64) >>> # import pylab as pl >>> # pl.gray() >>> # pl.matshow(digits.images[0]) # Visualize the first image >>> # pl.show()