# Create a DataFrame with clusters and varieties as columns: df df = pd.DataFrame({'labels': labels, 'varieties': varieties}) # Create crosstab: ct ct = pd.crosstab(df['labels'], df['varieties']) # Display ct print(ct)