@@ -375,19 +375,19 @@ def load_sample_images():
375
375
--------
376
376
To load the data and visualize the images::
377
377
378
- >>> from sklearn.datasets import load_sample_images
379
- >>> dataset = load_sample_images()
380
- >>> len(dataset.images)
381
- 2
382
- >>> first_img_data = dataset.images[0]
383
- >>> first_img_data.shape # height, width, channels
384
- (427, 640, 3)
385
- >>> first_img_data.dtype
386
- dtype('uint8')
387
- >>> # import pylab as pl
388
- >>> # pl.gray()
389
- >>> # pl.matshow(dataset.images[0]) # Visualize the first image
390
- >>> # pl.show()
378
+ # >>> from sklearn.datasets import load_sample_images
379
+ # >>> dataset = load_sample_images()
380
+ # >>> len(dataset.images)
381
+ # 2
382
+ # >>> first_img_data = dataset.images[0]
383
+ # >>> first_img_data.shape
384
+ # (427, 640, 3)
385
+ # >>> first_img_data.dtype
386
+ # dtype('uint8')
387
+ # >>> import pylab as pl
388
+ # >>> pl.gray()
389
+ # >>> pl.matshow(dataset.images[0]) # Visualize the first image
390
+ # >>> pl.show()
391
391
"""
392
392
# Try to import imread from scipy. We do this lazily here to prevent
393
393
# this module from depending on PIL.
@@ -415,18 +415,17 @@ def load_sample_images():
415
415
def load_sample_image (image_name ):
416
416
"""Load the numpy array of a single sample image
417
417
418
- >>> from sklearn.datasets import load_sample_image
419
- >>> china = load_sample_image('china.jpg')
420
- >>> china.dtype
421
- dtype('uint8')
422
- >>> china.shape
423
- (427, 640, 3)
424
-
425
- >>> flower = load_sample_image('flower.jpg')
426
- >>> flower.dtype
427
- dtype('uint8')
428
- >>> flower.shape
429
- (427, 640, 3)
418
+ # >>> from sklearn.datasets import load_sample_image
419
+ # >>> china = load_sample_image('china.jpg')
420
+ # >>> china.dtype
421
+ # dtype('uint8')
422
+ # >>> china.shape
423
+ # (427, 640, 3)
424
+ # >>> flower = load_sample_image('flower.jpg') # doctest: +SKIP
425
+ # >>> flower.dtype
426
+ # dtype('uint8')
427
+ # >>> flower.shape
4DB8
428
+ # (427, 640, 3)
430
429
"""
431
430
images = load_sample_images ()
432
431
index = None
0 commit comments