“Mehrere Kategorien auf Distply” Code-Antworten

Mehrere Kategorien auf Distplot

import numpy as np
import pandas as pd
from sklearn.datasets import load_iris
import seaborn as sns

iris = load_iris()
iris = pd.DataFrame(data=np.c_[iris['data'], iris['target']],
                    columns=iris['feature_names'] + ['target'])

# Sort the dataframe by target
target_0 = iris.loc[iris['target'] == 0]
target_1 = iris.loc[iris['target'] == 1]
target_2 = iris.loc[iris['target'] == 2]

sns.distplot(target_0[['sepal length (cm)']], hist=False, rug=True)
sns.distplot(target_1[['sepal length (cm)']], hist=False, rug=True)
sns.distplot(target_2[['sepal length (cm)']], hist=False, rug=True)

sns.plt.show()
Fantastic Fly

Mehrere Kategorien auf Distply

ordered_days = tips.day.value_counts().index
g = sns.FacetGrid(tips, row="day", row_order=ordered_days,
                  height=1.7, aspect=4,)
g.map(sns.distplot, "total_bill", hist=False, rug=True);
Fantastic Fly

Mehrere Kategorien auf Distply

sns.pairplot(iris, hue="species", height=2.5);
Fantastic Fly

Ähnliche Antworten wie “Mehrere Kategorien auf Distply”

Fragen ähnlich wie “Mehrere Kategorien auf Distply”

Weitere verwandte Antworten zu “Mehrere Kategorien auf Distply” auf Python

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen