Skip to content
Certification
Practical Exam - Boat Sales
Company Background Nearly New Nautical is a website that allows users to advertise their used boats for sale. The marketing team is preparing a weekly newsletter for boat owners. The newsletter is designed to help sellers to get more views of their boat, as well as stay on top of market trends. The Head of Marketing has laid out an ambitious goal of increasing the number of readers by 75% this year.
Customer Question
They would like you to tell them:
- Is it the most expensive boats that get the most views?
- Are there common features among the most viewed boats?
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_palette('colorblind')
pd.set_option('display.expand_frame_repr', False)df_orig = pd.read_csv('boat_data.csv')
df = df_orig.copy()
df.head(10)df.info()print(df.isna().sum())
df.dropna(inplace=True)print(df.isna().sum())
print(df.info())df[['Currency', 'Price']] = df['Price'].str.split(' ', expand=True)
df.head(10)df['Price'] = df['Price'].astype(int)
df['Currency'] = df['Currency'].astype('category')
df['Location'] = df['Location'].astype('category')
df['Material'] = df['Material'].astype('category')list = df['Location'].unique()
for l in list:
print(l)df['Location'] = df['Location'].str.replace('België,', 'Belgium')
df['Location'] = df['Location'].str.replace('espa?a', 'Spain')
list = df['Location'].unique()
for l in list:
print(l)sns.boxplot(x='Currency', y='Number of views last 7 days', data=df)ax = sns.lmplot(x='Price', y='Number of views last 7 days', data=df, ci=None, hue='Currency', scatter_kws={"alpha":0.5})
ax.set(xscale='log')
plt.show()location = df.groupby('Location')['Number of views last 7 days'].sum()
locationsns.boxplot(x='Location', y='Number of views last 7 days', data=df)