From 4eb95262ddc37b9ed393d85f22af81cc901fea8a Mon Sep 17 00:00:00 2001 From: Jas-simran Date: Fri, 4 Jan 2019 08:31:30 +0000 Subject: [PATCH 1/3] Done --- q01_plot/build.py | 18 ++++++++++++++++-- q02_plot/build.py | 15 ++++++++++++++- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/q01_plot/build.py b/q01_plot/build.py index 0425964..03a18a8 100644 --- a/q01_plot/build.py +++ b/q01_plot/build.py @@ -1,8 +1,22 @@ +# %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') -# 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]]) + plt.show() + + +columns = ['LotArea' ,'GarageArea', 'OpenPorchSF','SalePrice'] + + + +plot(columns) + + diff --git a/q02_plot/build.py b/q02_plot/build.py index 67b4924..b676070 100644 --- a/q02_plot/build.py +++ b/q02_plot/build.py @@ -1,11 +1,24 @@ +# %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 d1199edb79594cfede7950176e0f8bd586ff0d0f Mon Sep 17 00:00:00 2001 From: Jas-simran Date: Fri, 4 Jan 2019 08:33:20 +0000 Subject: [PATCH 2/3] Done --- q01_plot/build.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/q01_plot/build.py b/q01_plot/build.py index 03a18a8..5a3cae1 100644 --- a/q01_plot/build.py +++ b/q01_plot/build.py @@ -3,6 +3,8 @@ 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') From 19e4ad449e71e2ba7c82e8f02c4edb3353ad524e Mon Sep 17 00:00:00 2001 From: Jas-simran Date: Fri, 4 Jan 2019 08:42:51 +0000 Subject: [PATCH 3/3] Done --- q03_regression_plot/build.py | 17 ++++++++++++++++- q04_cor/build.py | 16 +++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/q03_regression_plot/build.py b/q03_regression_plot/build.py index 2aaf8f6..6c3c61d 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,11 +7,25 @@ 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]) +va1 = 'GrLivArea' +va2 = 'SalePrice' + + + + + + + +regression_plot(va1,va2) + + diff --git a/q04_cor/build.py b/q04_cor/build.py index f3fae50..315f5df 100644 --- a/q04_cor/build.py +++ b/q04_cor/build.py @@ -1,10 +1,24 @@ +# %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) + + +