<jupyter_start><jupyter_text>In this workspace, you will work with the fuel economy dataset from the previous lesson on bivariate plots.<jupyter_code>fuel_econ = pd.read_csv('./data/fuel_econ.csv')
fuel_econ.head()<jupyter_output><empty_output><jupyter_text>**Task 1**: Plot the city ('city') vs. highway ('highway') fuel efficiencies (both in mpg) for each vehicle class ('VClass'). Don't forget that vehicle class is an ordinal variable with levels {Minicompact Cars, Subcompact Cars, Compact Cars, Midsize Cars, Large Cars}.<jupyter_code># YOUR CODE HERE
g = sb.FacetGrid(data=fuel_econ, col='VClass', col_wrap=3)
g.map(plt.scatter, x=fuel_econ['city'], y=fuel_econ['highway'], alpha=0.5)
# run this cell to check your work against ours
adaptedplot_solution_1()<jupyter_output>Due to overplotting, I've taken a faceting approach to this task. There don't seem to be any obvious differences in the main cluster across vehicle classes, except that the minicompact and large sedans' arcs are thinner than the other classes due to lower counts. The faceted plots clearly show that most of the high-efficiency cars are in the mid-size and compact car classes.<jupyter_text>**Task 2**: Plot the relationship between engine size ('displ', in meters), vehicle class, and fuel type ('fuelType'). For the lattermost feature, focus only on Premium Gasoline and Regular Gasoline cars. What kind of relationships can you spot in this plot?<jupyter_code># YOUR CODE HERE
df = fuel_econ[fuel_econ.fuelType.isin(['Premium Gasoline', 'Regular Gasoline'])]
sb.boxplot(data=df, x='VClass', y='displ', hue='fuelType')
plt.xticks(rotation=15);
# run this cell to check your work against ours
adaptedplot_solution_2()<jupyter_output>I went with a clustered box plot on this task since there were too many levels to make a clustered violin plot accessible. The plot shows that in each vehicle class, engine sizes were larger for premium-fuel cars than regular-fuel cars. Engine size generally increased with vehicle class within each fuel type, but the trend was noisy for the smallest vehicle classes.
{'fraction_non_alphanumeric': 0.0845341018251681, 'fraction_numerical': 0.004322766570605188, 'mean_word_length': 5.943333333333333, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '267225', 'license': 'MIT', 'n_tokens_mistral': 632, 'n_tokens_neox': 581, 'n_words': 265, 'path': 'Data Visualization/3. Multivariate/Adapted_Plot_Practice.ipynb', 'repo_name': 'gubertoli/data_analyst_nanodegree', 'size': '2082'}