plot histogram in seaborn
sns.distplot(gapminder['lifeExp'], kde=False, color='red', bins=100)
plt.title('Life Expectancy', fontsize=18)
plt.xlabel('Life Exp (years)', fontsize=16)
plt.ylabel('Frequency', fontsize=16)
plot histogram in seaborn
sns.distplot(gapminder['lifeExp'], kde=False, color='red', bins=100)
plt.title('Life Expectancy', fontsize=18)
plt.xlabel('Life Exp (years)', fontsize=16)
plt.ylabel('Frequency', fontsize=16)
plot distribution seaborn
x = np.random.normal(size=100)
sns.distplot(x);
scatter density plot seaborn
>>> iris = sns.load_dataset("iris")
>>> g = sns.jointplot("sepal_width", "petal_length", data=iris,
... kind="kde", space=0, color="g")
mean =[0,0] covariance = [[1,0],[0,100]] ds = np.random.multivariate_normal(mean,covariance,500) dframe = pd.DataFrame(ds, columns=['col1', 'col2']) fig = sns.kdeplot(dframe).get_figure() fig.savefig('kde1.png')
mean =[0,0]
covariance = [[1,0],[0,100]]
ds = np.random.multivariate_normal(mean,covariance,500)
dframe = pd.DataFrame(ds, columns=['col1', 'col2'])
fig = sns.kdeplot(dframe).get_figure()
fig.savefig('kde1.png')
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()
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us