From 41a84c56f9f1997d11f81cde0e9a55f0f46c7008 Mon Sep 17 00:00:00 2001 From: tracedence Date: Wed, 14 Nov 2018 04:53:32 +0000 Subject: [PATCH 1/4] Done --- q01_plot/build.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/q01_plot/build.py b/q01_plot/build.py index 0425964..7cd626c 100644 --- a/q01_plot/build.py +++ b/q01_plot/build.py @@ -1,8 +1,20 @@ +# %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): + for i in range(len(num_cols)): + sns.distplot(data[num_cols[i]]) + return plt.show() + + +columns = ['LotArea' ,'GarageArea', 'OpenPorchSF','SalePrice'] +plot(columns) + + From ce97c652dd4abb8051067162d355d09c1aff53b2 Mon Sep 17 00:00:00 2001 From: tracedence Date: Wed, 14 Nov 2018 05:58:13 +0000 Subject: [PATCH 2/4] Done --- q02_plot/build.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/q02_plot/build.py b/q02_plot/build.py index 67b4924..e127b04 100644 --- a/q02_plot/build.py +++ b/q02_plot/build.py @@ -1,11 +1,21 @@ +# %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(num_cols): + for i in range(len(num_cols)): + sns.boxplot(data[num_cols[i]]) + plt.show() +columns = ['LotArea','GarageArea','OpenPorchSF','SalePrice'] +plot(columns) + + From b9fe7bce0796daadf3244b832fafb9a999d7f550 Mon Sep 17 00:00:00 2001 From: tracedence Date: Wed, 14 Nov 2018 06:02:58 +0000 Subject: [PATCH 3/4] Done --- q01_plot/build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/q01_plot/build.py b/q01_plot/build.py index 7cd626c..00643cc 100644 --- a/q01_plot/build.py +++ b/q01_plot/build.py @@ -11,7 +11,7 @@ def plot(num_cols): for i in range(len(num_cols)): sns.distplot(data[num_cols[i]]) - return plt.show() + plt.show() columns = ['LotArea' ,'GarageArea', 'OpenPorchSF','SalePrice'] From 494f750b390e91766cc1eabecc62f40756d561be Mon Sep 17 00:00:00 2001 From: tracedence Date: Wed, 14 Nov 2018 07:34:06 +0000 Subject: [PATCH 4/4] Done --- q03_regression_plot/build.py | 11 +++++++++-- q04_cor/build.py | 12 +++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/q03_regression_plot/build.py b/q03_regression_plot/build.py index 2aaf8f6..81d01cc 100644 --- a/q03_regression_plot/build.py +++ b/q03_regression_plot/build.py @@ -1,16 +1,23 @@ +# %load q03_regression_plot/build.py # Default imports import pandas as pd import seaborn as sns import matplotlib.pyplot as plt - data = pd.read_csv('data/house_prices_multivariate.csv') + plt.switch_backend('agg') +# Write your code here +def regression_plot(variable1, variable2): + + return sns.regplot(data[variable1], data[variable2]) -# Write your code here +va1 = 'GrLivArea' +va2 = 'SalePrice' +regression_plot(va1,va2) diff --git a/q04_cor/build.py b/q04_cor/build.py index f3fae50..b409dd4 100644 --- a/q04_cor/build.py +++ b/q04_cor/build.py @@ -1,10 +1,20 @@ +# %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): + + return sns.heatmap(data.corr()) + + +cor(data) + +