So does it figure out the mapping between 2-D array p and 1-D labels np.where(y_2_bin)[1] internally?
p
np.where(y_2_bin)[1]