<jupyter_start><jupyter_text>Working with the tips dataset<jupyter_code>import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
tips_data = sns.load_dataset('tips')
tips_data.head()
tips_data.describe()
sns.distplot(tips_data['total_bill'], kde=True).set_title('Histogram of total bill') # When kde=False,the curve of Gaussian is not visible 
plt.show()                                                                           # kde = Kernel Density Estimation
sns.distplot(tips_data['total_bill'], kde=False) # Nota good practice 
sns.distplot(tips_data['tip'], kde=False).set_title('Histogram of total bill and tip')
plt.show()
sns.boxplot(tips_data['total_bill']).set_title('Box plot of total bill')
plt.show()
sns.boxplot(tips_data['tip']).set_title('Box plot of the tips received')
plt.show()
sns.boxplot(tips_data['tip'])
sns.boxplot(tips_data['total_bill']).set_title('Box plot of total bill')
plt.show()
sns.boxplot(x=tips_data['tip'], y=tips_data['smoker'])
plt.show()
sns.boxplot(x=tips_data['tip'], y=tips_data['time'])
plt.show()

g = sns.FacetGrid(tips_data, row='time')
g = g.map(plt.hist, 'tip')
plt.show()
g = sns.FacetGrid(tips_data, row='sex', col='smoker')
g = g.map(plt.hist, 'total_bill')
plt.show
sns.boxplot(x=tips_data['tip'], y=tips_data['day'])
plt.show()

g = sns.FacetGrid(tips_data, row='day')
g = g.map(plt.hist, 'tip')
plt.show()
sns.relplot(x='total_bill', y='tip', data=tips_data)
plt.show()
sns.relplot(x='total_bill', y='tip', hue='smoker', data=tips_data)
plt.show()
# Categoorical data
sns.catplot(x='sex', y='tip', data=tips_data)
plt.show()
sns.catplot(x='day', y='total_bill', hue='sex', kind='swarm', data=tips_data)
plt.show()
sns.catplot(x='smoker', y='tip', order=['No', 'Yes'], data=tips_data)    # order also changes colour
plt.show()
sns.catplot(x='day', y='total_bill', hue='sex', kind='violin', data=tips_data)
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1849921834288692, 'fraction_numerical': 0.0, 'mean_word_length': 5.76056338028169, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '541818', 'license': 'MIT', 'n_tokens_mistral': 792, 'n_tokens_neox': 751, 'n_words': 139, 'path': 'Session_3.ipynb', 'repo_name': 'reeha-parkar/applied-statistics', 'size': '1919'}