Fix y_labels map iterator exhaustion in python 3