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 :: Return the key-value pairs in this RDD to the master as a dictionary. 
Python :: Return an RDD created by coalescing all elements within each partition into a list. 
Python :: Return a new RDD by applying a function to each element of this RDD. 
Python :: Sorts this RDD by the given keyfunc 
Python :: import data from website pandas python medium 
Python :: Filters rows using the given condition 
Python :: open chrome with python stack overflow 
Python :: python code for calculating probability of random variable 
Python :: use reshape in python with zeros 
Python :: assigning a value to a character in string or text file in python 
Python :: addinput() python 
Python :: mask and then fillnan# 
Python :: discord.py get channel name from id 
Python :: how to make commas appear in integers in terminal python 
Python :: anagrams python 
Python :: pandas mysql error in query concat with space 
Python :: rfe = RFE(lr, n_features_to_select=9) rfe.fit(X,Y) 
Python :: fonction parcourt en largeure sur un graphe 
Python :: print g 
Python :: Get the first item from an iterable that matches a condition 
Python :: Display all resources in table pandas 
Python :: add_node python 
Python :: discord.py embed length greater than 1024 
Python :: cptac dataset 
Python :: Django LogEntry or Change History 
Python :: how to subtract up everything in a list python 
Python :: leer fichero linea por linea python 
Python :: Adam RMSprop Adagrad. 
Python :: load data(review path) python 
Python :: arithmetic encoding python 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =