Mar-02-2022, 12:27 PM
I was working through a book on machine learning and came across this snippet of code.
Thanks.
import mglearn import matplotlib.pyplot as plt import numpy as np import pandas as pd from sklearn.datasets import fetch_lfw_people people = fetch_lfw_people(min_faces_per_person=20, resize = 0.7) image_shape = people.images[0].shape counts = np.bincount(people.target) for i, (count,name) in enumerate(zip(counts, people.target_names)): print("{0:25} {1:3}".format(name, count), end=' ') if (i+1)% 3 == 0: print()I'm not sure what is the use of {0:25} and {1:3} in the second last print function. I have not seen this before.
Thanks.