Difference makes the DIFFERENCE
seaborn.barplot(*, x=None, y=None, hue=None, data=None, order=None, hue_order=None, estimator=<function mean at 0x7ff320f315e0>, ci=95, n_boot=1000, units=None, seed=None, orient=None, color=None, palette=None, saturation=0.75, errcolor='.26', errwidth=None, capsize=None, dodge=True, ax=None, **kwargs)
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.style.use(['dark_background'])
import seaborn as sns
sns.set(color_codes = True)
t = sns.load_dataset("tips")
t.head()
sns.barplot(x="day", y='tip', data=t)
t['tip_fraction'] = t['tip']/t['total_bill']
t.head(2)
sns.barplot(x='day', y = 'tip_fraction', data = t)
sns.barplot(x="day", y='tip', data=t, estimator = np.median)
def my_estimate(v):
return np.quantile(v, 0.25)
sns.barplot(x="day", y='tip', data=t, estimator = my_estimate)
sns.barplot(x="day", y='tip', hue = 'sex', data=t, estimator = np.median)
sns.barplot(x="day", y='tip', hue = 'smoker', data=t, estimator = np.median)
sns.barplot(x="day", y='tip', hue = 'time', data=t, estimator = np.median)
sns.barplot(x="day", y='tip_fraction', hue = 'sex', data=t, estimator = np.median)
sns.barplot(x = 'time', y='tip', data = t, order=['Dinner', 'Lunch'])
sns.barplot(x="size", y="total_bill", data=t, palette="Blues_d")
t['weekend'] = t['day'].isin (['Sat', 'Sun'])
t.head()
sns.barplot(x="day", y="total_bill", hue="weekend",
data=t, dodge=False)
sns.catplot(x="sex", y="total_bill",
hue="smoker", col="time",
data=t, kind="bar",
height=4, aspect=.7);
d = sns.load_dataset('diamonds')
d.head()
sns.scatterplot('x', y='price', data=d.sample(1000))
sns.barplot('x', y='price', data=d.sample(1000))
d['x_q'] = pd.cut(d['x'], bins = 15)
d['x_q'].unique()
d.head(2)
sns.barplot('x_q', y='price', data=d)
d['x_q'] = pd.cut(d['x'], bins = 15, labels = False)
sns.barplot('x_q', y='price', data=d)
f = sns.load_dataset("fmri")
f.info()
f.describe()
f.head()
f['region'].unique()
sns.lineplot('timepoint', 'signal', data=f)
f['timepoint'].unique()
f['event'].unique()
sns.lineplot('timepoint', 'signal', data=f, hue='region')
sns.lineplot('timepoint', 'signal', data=f, hue='event')
sns.lineplot('timepoint', 'signal', data=f, hue='event', style = 'region')
sns.lineplot('timepoint', 'signal', data=f, hue='region', marker = True)
sns.lineplot('timepoint', 'signal', data=f, hue='region', estimator = np.median)
f['subject'].unique()
sns.lineplot('timepoint', 'signal', data = f, units = 'subject', estimator = None)
f_ = f[(f['region'] == 'parietal') & (f['event'] == 'cue')]
f_.head()
sns.lineplot('timepoint', 'signal', data = f_, units = 'subject', estimator = None)
sns.lineplot('timepoint', 'signal', data = f_, hue = 'subject', estimator = None)
sns.lineplot('timepoint', 'signal', data = f_, hue = 'subject', estimator = None)
x = np.array([-1,-2,-3,-4,-5,0,1,2,3,4,5])
y = x * x
sns.lineplot(x, y)
!pip install nbconvert
%shell jupyter nbconvert --to html /content/testfile.ipynb