Horje
python create adictionary randomly assigning clors to categorical vairables Code Example
python create adictionary randomly assigning clors to categorical vairables
# Unique category labels: 'D', 'F', 'G', ...
color_labels = df['color'].unique()

# List of RGB triplets
rgb_values = sns.color_palette("Set2", 8)

# Map label to RGB
color_map = dict(zip(color_labels, rgb_values))

# Finally use the mapped values
plt.scatter(df['carat'], df['price'], c=df['color'].map(color_map))
python create adictionary randomly assigning clors to categorical vairables
sns.palplot(sns.color_palette("Set2", 8))




Python

Related
max sum slice python 5 - autopilot Code Example max sum slice python 5 - autopilot Code Example
voting classifier with different features Code Example voting classifier with different features Code Example
python just 4 test Code Example python just 4 test Code Example
numpy create array with infinities Code Example numpy create array with infinities Code Example
discord rich presence python Code Example discord rich presence python Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7