With py3k, it is probably safer to make `step = n_samples // n_classes`