From 1a53312d492b0edf07bdecee6653b6db7772983e Mon Sep 17 00:00:00 2001 From: sunilhariharan Date: Wed, 14 Nov 2018 14:54:12 +0000 Subject: [PATCH 1/4] Done --- q01_plot/build.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/q01_plot/build.py b/q01_plot/build.py index 0425964..1bb3458 100644 --- a/q01_plot/build.py +++ b/q01_plot/build.py @@ -1,8 +1,21 @@ +# %load q01_plot/build.py +# Default imports import matplotlib.pyplot as plt import seaborn as sns import pandas as pd - +import numpy as np 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): + num_cols=[data['LotArea'],data['GarageArea'],data['OpenPorchSF'],data['SalePrice']] + Plot=plt.hist(num_cols, bins=50, alpha=0.5, label=['LotArea','GarageArea','OpenPorchSF','SalePrice']) + + plt.legend(loc='upper right') + + + return Plot + + + + From f812b32d0ab0ea0e5717978a52d5eefc6f2fd81f Mon Sep 17 00:00:00 2001 From: sunilhariharan Date: Wed, 14 Nov 2018 15:00:05 +0000 Subject: [PATCH 2/4] Done --- q02_plot/build.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/q02_plot/build.py b/q02_plot/build.py index 67b4924..a4abd7b 100644 --- a/q02_plot/build.py +++ b/q02_plot/build.py @@ -1,11 +1,17 @@ +# %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: +def plot(num_cols): + num_cols=[data['LotArea'],data['GarageArea'],data['OpenPorchSF'],data['SalePrice']] + Plot=plt.boxplot(num_cols) + return Plot + + From 9f81a1ed522427b86be341fa14f2da699c7ea3d4 Mon Sep 17 00:00:00 2001 From: sunilhariharan Date: Wed, 14 Nov 2018 15:18:57 +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..5f33c4f 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 +def regression_plot(variable1,variable2): + variable1=data.loc[:,'SalePrice'] + + variable2=data.loc[:,'GrLivArea'] + Plot=plt.scatter(variable1,variable2) + return Plot + From fb0f0fb027518a730ee982e97d620e957b75edf6 Mon Sep 17 00:00:00 2001 From: sunilhariharan Date: Thu, 15 Nov 2018 07:19:36 +0000 Subject: [PATCH 4/4] Done --- q04_cor/build.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/q04_cor/build.py b/q04_cor/build.py index f3fae50..aca8539 100644 --- a/q04_cor/build.py +++ b/q04_cor/build.py @@ -1,10 +1,19 @@ +# %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') # Write your code here +def cor(data): + corr = data.corr() + + + Plot=sns.heatmap(corr,xticklabels=corr.columns,yticklabels=corr.columns) + return Plot + + +