<jupyter_start><jupyter_text>Seaborn- What is Seaborn?Seaborn is a Python data visualization library based on matplotlib.<jupyter_code>import pandas as pd
import seaborn as sns
import warnings
warnings.filterwarnings("ignore")<jupyter_output><empty_output><jupyter_text>Let's import that car data we had from before<jupyter_code>df = pd.read_csv('CleanData/part-00000-d1116d87-9af4-4430-8498-6eff6661dbf4-c000.csv')
df.head()<jupyter_output><empty_output><jupyter_text>Let's do a histogram with a distribution line drawn on top<jupyter_code>sns.histplot(df['Comb FE'], kde=True, stat="density", linewidth=0)<jupyter_output><empty_output><jupyter_text>Now let's check out a pairplot<jupyter_code>sns.pairplot(df[['# Cyl', '# Gears', 'Comb FE']])<jupyter_output><empty_output><jupyter_text>If we want to isolate one of the pairs of data, we can use scatterplot<jupyter_code>sns.scatterplot(x='# Cyl', y='Comb FE', data=df)<jupyter_output><empty_output><jupyter_text>If we wanted to add in a linear regression line, this is how we would do it<jupyter_code>sns.lmplot(x='# Cyl', y='Comb FE', data=df)<jupyter_output><empty_output><jupyter_text>Now let's check out a box and whisker plot to see the ranges of feul efficiency for each manufacturer. Each box represents the range between the first and third quartiles of the data, with a line representing the median value.<jupyter_code>sns.set(rc={'figure.figsize':(18,7)})  # this makes our graph a little bigger
ax = sns.boxplot(x='Mfr Name', y='Comb FE', data=df)
ax.set_xticklabels(ax.get_xticklabels(),rotation=45)# this will make it easier to read the manufacturers names<jupyter_output><empty_output><jupyter_text>Here's another cool way to look at the data, similar to a boxplot. It groups data points<jupyter_code>ax = sns.swarmplot(x='Mfr Name', y='Comb FE', data=df)
ax.set_xticklabels(ax.get_xticklabels(),rotation=45)<jupyter_output><empty_output><jupyter_text>Finally, let's check out a simple countplot that counts the number of cars per manufacturer<jupyter_code>ax = sns.countplot(x='Mfr Name', data=df, order=df['Mfr Name'].value_counts().index)
ax.set_xticklabels(ax.get_xticklabels(),rotation=45)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11689497716894977, 'fraction_numerical': 0.0182648401826484, 'mean_word_length': 8.129166666666666, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '644362', 'license': 'MIT', 'n_tokens_mistral': 803, 'n_tokens_neox': 765, 'n_words': 199, 'path': 'Seaborn.ipynb', 'repo_name': 'AidanFarhi/ResearchProject', 'size': '2190'}