Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

multiple categories on 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()
Comment

multiple categories on distploy

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);
Comment

multiple categories on distploy

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

PREVIOUS NEXT
Code Example
Python :: python pandas rellenar con ceros a la izquierda 
Python :: STATPC 
Python :: pyhton dms to decimal 
Python :: python create valid filename from string 
Python :: Change Separator Value When Printing 
Python :: python loop nest shorthand 
Python :: seaborn boxplot change filling 
Python :: pandas.describe per group 
Python :: python string ignore characters 
Python :: difference between local and global variable in python 
Python :: django set cookie 
Python :: undef variable 
Python :: how to change the main diagonal in pandas 
Python :: pythonhashseed 
Python :: debugging python 
Python :: pandas array of dataframes 
Python :: python program to check whether a specified value is contained in a group of values 
Python :: get sum of column before a date python 
Python :: how to iterate through a pandas dataframe 
Python :: confusion matrix code 
Python :: python custom class indexing 
Python :: pyton como identificar se é numero 
Python :: python indian currency formatter 
Python :: setting python2 in the path for npm install 
Python :: can i call a python script from a function 
Python :: input and print 
Python :: a star search algorithm python code 
Python :: python menentukan genap ganjil 
Python :: activate venv environment 
Python :: number string array 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =