From 5e0838892ab6d150f0406aa875d5a82a9f559375 Mon Sep 17 00:00:00 2001 From: amagarwal-18 Date: Wed, 28 Nov 2018 05:06:42 +0000 Subject: [PATCH 1/4] Done --- q01_plot/build.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/q01_plot/build.py b/q01_plot/build.py index 0425964..3d59649 100644 --- a/q01_plot/build.py +++ b/q01_plot/build.py @@ -1,8 +1,17 @@ +# %load q01_plot/build.py +# Default imports import matplotlib.pyplot as plt import seaborn as sns import pandas as pd data = pd.read_csv('data/house_prices_multivariate.csv') + plt.switch_backend('agg') +def plot(num_cols): + for col in num_cols: + sns.distplot(data[col], kde=True) + plt.show() +num_cols = ['LotArea', 'GarageArea', 'OpenPorchSF', 'SalePrice'] +plot(num_cols) + -# Write your code here : From d1ad3330f12a7c2cbe24f13a93d84bdee364ba44 Mon Sep 17 00:00:00 2001 From: amagarwal-18 Date: Wed, 28 Nov 2018 05:07:45 +0000 Subject: [PATCH 2/4] Done --- q02_plot/build.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/q02_plot/build.py b/q02_plot/build.py index 67b4924..68ee5b0 100644 --- a/q02_plot/build.py +++ b/q02_plot/build.py @@ -1,11 +1,20 @@ +# %load q02_plot/build.py # Default imports import pandas as pd import matplotlib.pyplot as plt import seaborn as sns data = pd.read_csv('data/house_prices_multivariate.csv') -plt.switch_backend('agg') # Write your code here: +plt.switch_backend('agg') +def plot(num_cols): + for col in num_cols: + sns.boxplot(x=data[col]) + plt.show() +num_cols = ['LotArea', 'GarageArea', 'OpenPorchSF', 'SalePrice'] +plot(num_cols) + + From c4a773b76095e32d81c3fa5fc4e842ca3ca5dcdb Mon Sep 17 00:00:00 2001 From: amagarwal-18 Date: Wed, 28 Nov 2018 05:08:37 +0000 Subject: [PATCH 3/4] Done --- q03_regression_plot/build.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/q03_regression_plot/build.py b/q03_regression_plot/build.py index 2aaf8f6..bc5d932 100644 --- a/q03_regression_plot/build.py +++ b/q03_regression_plot/build.py @@ -1,3 +1,4 @@ +# %load q03_regression_plot/build.py # Default imports import pandas as pd @@ -6,10 +7,16 @@ data = pd.read_csv('data/house_prices_multivariate.csv') -plt.switch_backend('agg') # Write your code here +plt.switch_backend('agg') +def regression_plot(variable1, variable2): + plot = sns.lmplot(variable1, variable2, data, fit_reg=True) + return plot +regression_plot('SalePrice', 'GrLivArea') + + From 61b5c554fed32120caeae0339ca150e50b509630 Mon Sep 17 00:00:00 2001 From: amagarwal-18 Date: Wed, 28 Nov 2018 05:10:20 +0000 Subject: [PATCH 4/4] Done --- q04_cor/build.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/q04_cor/build.py b/q04_cor/build.py index f3fae50..ac413b0 100644 --- a/q04_cor/build.py +++ b/q04_cor/build.py @@ -1,10 +1,16 @@ +# %load q04_cor/build.py # Default imports import pandas as pd import matplotlib.pyplot as plt import seaborn as sns data = pd.read_csv('data/house_prices_multivariate.csv') + + plt.switch_backend('agg') +def cor(data): + return sns.heatmap(data.corr()) +cor(data) + -# Write your code here