From 1e7ad5b67ece7f1f657db20062d948710467e2c1 Mon Sep 17 00:00:00 2001 From: psicktrick Date: Tue, 11 Dec 2018 09:03:49 +0000 Subject: [PATCH 1/4] Done --- q01_plot/build.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/q01_plot/build.py b/q01_plot/build.py index 0425964..462a469 100644 --- a/q01_plot/build.py +++ b/q01_plot/build.py @@ -1,8 +1,24 @@ +# %load q01_plot/build.py +# Default imports import matplotlib.pyplot as plt import seaborn as sns import pandas as pd +plt.switch_backend('agg') data = pd.read_csv('data/house_prices_multivariate.csv') -plt.switch_backend('agg') -# Write your code here : +# Write your code here: +def plot(num_cols): + f, axes = plt.subplots(2, 2, figsize=(15, 12)) + sns.distplot(data['GarageArea'], ax = axes[0,0]) + sns.distplot(data['LotArea'], ax = axes[0,1]) + sns.distplot(data['OpenPorchSF'], ax = axes[1,0]) + sns.distplot(data['SalePrice'], ax = axes[1,1]) + plt.show() + return plt + + +plot(data) + + + From 9509743f44e66f9031d78adf756f4f7ffd130d16 Mon Sep 17 00:00:00 2001 From: psicktrick Date: Tue, 11 Dec 2018 14:20:44 +0000 Subject: [PATCH 2/4] Done --- q02_plot/build.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/q02_plot/build.py b/q02_plot/build.py index 67b4924..d269c3a 100644 --- a/q02_plot/build.py +++ b/q02_plot/build.py @@ -1,11 +1,25 @@ +# %load q02_plot/build.py # Default imports import pandas as pd import matplotlib.pyplot as plt import seaborn as sns +plt.switch_backend('agg') data = pd.read_csv('data/house_prices_multivariate.csv') -plt.switch_backend('agg') # Write your code here: +def plot(data): + f, axes = plt.subplots(2, 2, figsize=(15, 12)) + sns.boxplot(data['GarageArea'], ax = axes[0,0]) + sns.boxplot(data['LotArea'], ax = axes[0,1]) + sns.boxplot(data['OpenPorchSF'], ax = axes[1,0]) + sns.boxplot(data['SalePrice'], ax = axes[1,1]) + plt.show() + + + +plot(data) + + From 1265c2f1507bf46257467921f58f0fe4a07837d7 Mon Sep 17 00:00:00 2001 From: psicktrick Date: Tue, 11 Dec 2018 14:25:47 +0000 Subject: [PATCH 3/4] Done --- q03_regression_plot/build.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/q03_regression_plot/build.py b/q03_regression_plot/build.py index 2aaf8f6..61fa63c 100644 --- a/q03_regression_plot/build.py +++ b/q03_regression_plot/build.py @@ -1,16 +1,24 @@ +# %load q03_regression_plot/build.py # Default imports import pandas as pd import seaborn as sns import matplotlib.pyplot as plt +plt.switch_backend('agg') data = pd.read_csv('data/house_prices_multivariate.csv') -plt.switch_backend('agg') - +v1 = data['SalePrice'] +v2 = data['GrLivArea'] # Write your code here +def regression_plot(v1, v2): + sns.regplot(x=v2,y=v1) + plt.show() + + +regression_plot(v1, v2) From c6c9549d4804ce8026b57aa6a2a9ed779821a495 Mon Sep 17 00:00:00 2001 From: psicktrick Date: Tue, 11 Dec 2018 14:31:59 +0000 Subject: [PATCH 4/4] Done --- q04_cor/build.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/q04_cor/build.py b/q04_cor/build.py index f3fae50..0a1835c 100644 --- a/q04_cor/build.py +++ b/q04_cor/build.py @@ -1,10 +1,17 @@ +# %load q04_cor/build.py # Default imports import pandas as pd import matplotlib.pyplot as plt import seaborn as sns +plt.switch_backend('agg') data = pd.read_csv('data/house_prices_multivariate.csv') -plt.switch_backend('agg') # Write your code here +def cor(data): + sns.heatmap(data.corr()) + plt.show() + +cor(data) +