Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

distplot for 2 columns

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

PREVIOUS NEXT
Code Example
Python :: grouped bar chart with labels 
Python :: fibonacci 10th 
Python :: numpy convolution stride tricks 
Python :: how to draw play area for a game in python turtle 
Python :: pycharm shortcut to create methos 
Python :: django.com 
Python :: gcp jupyter use python variables in magic bigquery 
Python :: pyqt message box set information text 
Python :: come mettere una scelta su python 
Python :: np.modf 
Python :: Desviacion estandard en pandas 
Python :: python insert text in string before certain symbol 
Python :: Python Using Global and Local variables in the same code 
Python :: admin email errors 
Python :: Python Print year, month, hour, minute and timestamp 
Python :: plotly two y axis bar chart 
Python :: does xgboost accept pandas 
Python :: jittering(adding back rounded up values) 
Python :: rom requests_html import HTML 
Python :: python ternary mittels ganz schlimm 
Python :: sample regression algorithm using pipeline with hyperparameter tuning 
Python :: python4 
Python :: raspian image with preinstalled python3 
Python :: How to use a function output as an input of another function in Python 
Python :: printing range of index in python 
Python :: tkinder 
Python :: pyqt set widget size 
Python :: pandas python multiindex 
Python :: hover 777-286 
Python :: give utton a number python 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =