From 0e845c4122c7b07f69c81bd81caa80b7bf670e63 Mon Sep 17 00:00:00 2001 From: sagark93 Date: Tue, 29 Jan 2019 10:35:31 +0000 Subject: [PATCH 1/2] Done --- q01_plot/build.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/q01_plot/build.py b/q01_plot/build.py index 0425964..4a99524 100644 --- a/q01_plot/build.py +++ b/q01_plot/build.py @@ -1,8 +1,25 @@ +# %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): +# plt.hist() +# plot = sns.distplot(data, kde=False, rug=True) + sns.distplot( data['LotArea'] , color='skyblue', label='Lot Area') + sns.distplot( data['GarageArea'] , color='red', label='Garage Area') + sns.distplot( data['OpenPorchSF'] , color='green', label='Open Porch') + sns.distplot( data['SalePrice'] , color='yellow', label='Sale P') + + # return plot + + +num_cols = list([data['LotArea'],data['GarageArea'],data['OpenPorchSF'],data['SalePrice']]) + + From d84a759ddf1f088862a93e33d07357ab18b85804 Mon Sep 17 00:00:00 2001 From: sagark93 Date: Tue, 29 Jan 2019 11:54:20 +0000 Subject: [PATCH 2/2] Done --- q03_regression_plot/build.py | 18 +++++++++++++++++- q04_cor/build.py | 10 +++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/q03_regression_plot/build.py b/q03_regression_plot/build.py index 2aaf8f6..bf90028 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,26 @@ data = pd.read_csv('data/house_prices_multivariate.csv') -plt.switch_backend('agg') # Write your code here +variable1 = data['SalePrice'] +variable2 = data['GrLivArea'] +# +regression_plot(variable1, variable2) +import matplotlib.pyplot as plt +import seaborn as sns + +import pandas as pd + +data = pd.read_csv('data/house_prices_multivariate.csv') + +def regression_plot(variable1, variable2): + sns.jointplot(variable1, variable2, data=data, kind='reg') + return plt.show() + + diff --git a/q04_cor/build.py b/q04_cor/build.py index f3fae50..8d18e81 100644 --- a/q04_cor/build.py +++ b/q04_cor/build.py @@ -1,10 +1,18 @@ +# %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): + return data.corr() + +cor(data) +