Neural Sync Active
Seaborn
Registry Synced
Seaborn
73 words
1 min read
Seaborn
pythonimport seaborn as sns import matplotlib.pyplot as plt import pandas as pd import numpy as np # Load built-in dataset df = sns.load_dataset('tips') # Distribution sns.histplot(df['total_bill'], kde=True) plt.title('Distribution of Total Bill') plt.show() # Box plot by category sns.boxplot(data=df, x='day', y='total_bill', hue='sex') plt.show() # Pairplot sns.pairplot(df, hue='smoker') plt.show() # Regression plot sns.lmplot(data=df, x='total_bill', y='tip', hue='sex') plt.show() # FacetGrid g = sns.FacetGrid(df, col='time', row='sex') g.map(sns.histplot, 'total_bill') plt.show()