From 3d1c153943a1a83449c367df56b10fbcc38868d0 Mon Sep 17 00:00:00 2001 From: iampa1 Date: Mon, 14 Jan 2019 12:59:08 +0000 Subject: [PATCH 1/4] Done --- __pycache__/__init__.cpython-36.pyc | Bin 168 -> 153 bytes .../__pycache__/__init__.cpython-36.pyc | Bin 193 -> 178 bytes .../__pycache__/build.cpython-36.pyc | Bin 630 -> 517 bytes q01_calculate_statistics/build.py | 10 +++++++++- .../tests/__pycache__/__init__.cpython-36.pyc | Bin 199 -> 184 bytes .../__pycache__/test_q01_plot.cpython-36.pyc | Bin 2949 -> 2934 bytes 6 files changed, 9 insertions(+), 1 deletion(-) diff --git a/__pycache__/__init__.cpython-36.pyc b/__pycache__/__init__.cpython-36.pyc index cd8686b0f9f17c173480b2b430af88fa1427ca13..9185e6c6cece676e8293c3dac7afb6871016da56 100644 GIT binary patch delta 48 zcmZ3%IFpgXn3tE!vfU2*(a@TmYOSigqy6F%Hmm-2r4laU)qfo*n;?>JtNLsI)oqy_=qm)nIkhfrJSV zP`pF#imPp~Gn~udJ4UQwMY=%RGr|a&zo=q2Wh-HmW^a)tNd)mD!6$pP?HNuap1pEmI z5IC9yu4ZMe?E-kIJ;`$z*CLHUI|U>ua&uNEkuw63fIm<+KpgaRr)-LPDi~IgQ}Z(6QaD&FKj_}6IbADkr>-OqKeT&>8#Otc8*|&- Kr7rX6PWKOiJ#LKv diff --git a/q01_calculate_statistics/build.py b/q01_calculate_statistics/build.py index a556241..6c9a6a2 100644 --- a/q01_calculate_statistics/build.py +++ b/q01_calculate_statistics/build.py @@ -1,11 +1,19 @@ +# %load q01_calculate_statistics/build.py # Default Imports import numpy as np import pandas as pd data = pd.read_csv('data/house_prices_multivariate.csv') -sale_price = data.loc[:, "SalePrice"] +sale_price = data.loc[:, 'SalePrice'] # Return mean,median & mode for the SalePrice Column # Write your code here +def calculate_statistics(): + return sale_price.mean(),sale_price.median(),sale_price.mode()[0] + + +sale_price.mode()[0] +calculate_statistics() + diff --git a/q01_calculate_statistics/tests/__pycache__/__init__.cpython-36.pyc b/q01_calculate_statistics/tests/__pycache__/__init__.cpython-36.pyc index b1b01d55acae938b089c65022c1e5efe684e3182..8aac5da155c4de597f7a4312bce59ad24a915975 100644 GIT binary patch delta 48 zcmX@kxPy_yn3tE!rrjoHB8Rz5s(wa(ZmND}Vs1gAp?-LNQFd`bVsff}a(+tc#H?5V DUAYg< delta 63 zcmdnNc$|^Ln3tF9Mq+E!L=JQ968(()+*JLM~`m;B_?+|<01V*T`@)XKz?{9OIS SoE(LMqWrAX)W diff --git a/q01_calculate_statistics/tests/__pycache__/test_q01_plot.cpython-36.pyc b/q01_calculate_statistics/tests/__pycache__/test_q01_plot.cpython-36.pyc index b15e8f5a2811026190ae68242820f0f54cca9426..c426b8e98ed417575bfdebda5463848d0bb47cb5 100644 GIT binary patch delta 51 zcmZn_|0c#^%*)GV({2;9k>e<%OqPB|er~FMW@2tZqM?3xeo=ODL1J>MesX?F>gFGe Gy_^7~#1WDJ delta 66 zcmew+)+)|n%*)GlBe6AVBgauj?MnTO{M=Oi#H5T&eV6>?(%jU%l4AYzqSVU7lKfo# V#GD+3f};Ga)Z~)l%`X{yIROjL7<&K! From 1746ad2c393e7c053a69501d08de3aa542fd0c9f Mon Sep 17 00:00:00 2001 From: iampa1 Date: Wed, 16 Jan 2019 05:15:35 +0000 Subject: [PATCH 2/4] Done --- q02_plot/__pycache__/__init__.cpython-36.pyc | Bin 177 -> 162 bytes q02_plot/__pycache__/build.cpython-36.pyc | Bin 775 -> 948 bytes q02_plot/build.py | 22 +++++++++++++++++- .../tests/__pycache__/__init__.cpython-36.pyc | Bin 183 -> 168 bytes .../__pycache__/test_q02_plot.cpython-36.pyc | Bin 969 -> 954 bytes 5 files changed, 21 insertions(+), 1 deletion(-) diff --git a/q02_plot/__pycache__/__init__.cpython-36.pyc b/q02_plot/__pycache__/__init__.cpython-36.pyc index 215eac083bf88e6537e6d7d6a5471a2c374ca81c..2ad5d460736a420e176132e8e198ecc2135bc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 --- a/q02_plot/build.py +++ b/q02_plot/build.py @@ -1,12 +1,32 @@ +# %load q02_plot/build.py # Default Imports import pandas as pd import matplotlib.pyplot as plt from greyatomlib.descriptive_stats.q01_calculate_statistics.build import calculate_statistics - plt.switch_backend('agg') dataframe = pd.read_csv('data/house_prices_multivariate.csv') sale_price = dataframe.loc[:, 'SalePrice'] # Draw the plot for the mean, median and mode for the dataset +def plot(): + _,args=plt.subplots(1,3) + args[0].axvline(sale_price.mean()) + args[1].axvline(sale_price.median()) + args[2].axvline(sale_price.mode()[0]) + + +_,args=plt.subplots(1,3) +args[0].axvline(sale_price.mean()) +args[1].axvline(sale_price.median()) +args[2].axvline(sale_price.mode()[0]) + + +args[0].hist(dataframe.SalePrice) + +plt.show() +dataframe +plt.ion() +plt.get_backend() + diff --git a/q02_plot/tests/__pycache__/__init__.cpython-36.pyc b/q02_plot/tests/__pycache__/__init__.cpython-36.pyc index 488a8902e9cb8aed0f38d008a72db519050c874f..bf15db0b67c686388110704e16f03e53aab9848c 100644 GIT binary patch delta 48 zcmdnaxPpM~`m;B_?+|<01V*T`@)XKz?{9OIS SoE(LMqWrAXMesX?F>gM%~ GQcM7n0T5gO delta 66 zcmdnRev+NTn3tDpkM!KAjT|+M+L`(p`MIh3iAfom`Y!p&rManjCB^#bMX8mECHcAf Wi8(n61x5K;smUe9n-?%jF#!PKi5C6< From 3f4e57ace20c8fd5549ef839372a242d66e32a97 Mon Sep 17 00:00:00 2001 From: iampa1 Date: Wed, 16 Jan 2019 05:18:15 +0000 Subject: [PATCH 3/4] Done --- .../__pycache__/__init__.cpython-36.pyc | Bin 192 -> 177 bytes .../__pycache__/build.cpython-36.pyc | Bin 494 -> 490 bytes q03_pearson_correlation/build.py | 7 +++++++ .../tests/__pycache__/__init__.cpython-36.pyc | Bin 198 -> 183 bytes .../test_q03_correlation.cpython-36.pyc | Bin 1680 -> 1665 bytes 5 files changed, 7 insertions(+) diff --git a/q03_pearson_correlation/__pycache__/__init__.cpython-36.pyc b/q03_pearson_correlation/__pycache__/__init__.cpython-36.pyc index 543c178c4df3a2d7e5b64ffe37ce6264e5b948ea..c5ffbd35ebd2ea9f408537c9ea1a9559ff8de7de 100644 GIT binary patch delta 48 zcmX@WxRH^=n3tE!vfUWp_<%$SLl$EeQwehxV>4qggC?V&Cd)1El*E$6w4%h^)Of>N6JKb_ zMC)hd=cejsCgv6-8tRAV7iAY0BqpcoC+DZ6PPS!?)8&X_D@e>sNi4p_RFD$IQIwjP q5}#aLRs^!Dh!sR|fCy#~!7_OtqoOc~S3^)dxBXfpdnu@|H!78U2`X)@ko%S|oG$WPH^xy7B5Sdy4ll$e_uZx}W4 zsg`z@enx(7s(xZpMy9??esXDUYFoeT#Q_70MpGm AM*si- diff --git a/q03_pearson_correlation/build.py b/q03_pearson_correlation/build.py index 33a762b..37f28bd 100644 --- a/q03_pearson_correlation/build.py +++ b/q03_pearson_correlation/build.py @@ -1,3 +1,4 @@ +# %load q03_pearson_correlation/build.py # Default Imports import pandas as pd @@ -7,3 +8,9 @@ # Return the correlation value between the SalePrice column for the two loaded datasets # Your code here +def correlation(): + return dataframe_1.SalePrice.corr(dataframe_2.SalePrice) +dataframe_1.SalePrice.corr(dataframe_2.SalePrice) +correlation() + + diff --git a/q03_pearson_correlation/tests/__pycache__/__init__.cpython-36.pyc b/q03_pearson_correlation/tests/__pycache__/__init__.cpython-36.pyc index d7eca9980cd94014cb671238783d84df5e9fb7da..3479bcb6fc16ed38f152587a61a50b1c53ee8262 100644 GIT binary patch delta 48 zcmX@cxSf&1n3tE!vfUM~`m;B_?+|<01V*T`@)XKz?{9OIS SoE(LMqWrAXMesX?F>gKbI GhgkrI;}G)z delta 66 zcmZqVoxsas%*)GlBe6AVBgZU8?Rx!;{M=Oi#H5T&eV6>?(%jU%l4AYzqSVU7lKfo# W#GD+3f};Ga)Z~)l&HES+vj70&;TPWk From d6693cadad0a5616cc1067f91f3e722db853f8ea Mon Sep 17 00:00:00 2001 From: iampa1 Date: Wed, 16 Jan 2019 05:21:39 +0000 Subject: [PATCH 4/4] Done --- .../__pycache__/build.cpython-36.pyc | Bin 490 -> 490 bytes .../__pycache__/__init__.cpython-36.pyc | Bin 193 -> 178 bytes .../__pycache__/build.cpython-36.pyc | Bin 505 -> 486 bytes q04_spearman_correlation/build.py | 6 ++++++ .../tests/__pycache__/__init__.cpython-36.pyc | Bin 199 -> 184 bytes ...st_q04_spearman_correlation.cpython-36.pyc | Bin 1717 -> 1702 bytes 6 files changed, 6 insertions(+) diff --git a/q03_pearson_correlation/__pycache__/build.cpython-36.pyc b/q03_pearson_correlation/__pycache__/build.cpython-36.pyc index c9ffaa55c1607810af8832e83ee680881ace8010..08815d7a6c45423a9d0b27b70ff0a24fdfdd9372 100644 GIT binary patch delta 14 VcmaFG{EC^?n3tDp<3`q}i~u7k1cU$p delta 14 VcmaFG{EC^?n3tEUZzJndMgSsu1YrOG diff --git a/q04_spearman_correlation/__pycache__/__init__.cpython-36.pyc b/q04_spearman_correlation/__pycache__/__init__.cpython-36.pyc index 78682675323d8e4b951373280266bfae3fe10d8b..8539862b5e527c0ba842043aef46903dee3898ac 100644 GIT binary patch delta 48 zcmX@exQUU&n3tE!vfU{sHg};{EE@f$j?pH&rHlM zNHo+B&o9a@E=WvH)lbe(Nu6xRm>k6hRHexl#a57*my%d~i>V+bilZnsF(p2^xU2}| qnj(SYRM&}8~|l98V>@v?y_D^Nobi1?MQpOK%N zs-KvYk*V*JpIn-onpaY+pI($&nOKsatDl&Yqfk(kpOu=uVjZhlH>PO2Tq*~K6s4kj)}E*1c%Loze~ diff --git a/q04_spearman_correlation/build.py b/q04_spearman_correlation/build.py index 557be32..727456d 100644 --- a/q04_spearman_correlation/build.py +++ b/q04_spearman_correlation/build.py @@ -1,3 +1,4 @@ +# %load q04_spearman_correlation/build.py # Default Import import pandas as pd @@ -5,4 +6,9 @@ dataframe_2 = pd.read_csv('data/house_prices_copy.csv') # Your code here +def spearman_correlation(): + return dataframe_1.SalePrice.corr(dataframe_2.SalePrice,'spearman') + +spearman_correlation() + diff --git a/q04_spearman_correlation/tests/__pycache__/__init__.cpython-36.pyc b/q04_spearman_correlation/tests/__pycache__/__init__.cpython-36.pyc index 495646a3bc5e900ad0593288f8e14eb5f8ed301b..251a48043785e26f8fb9c097022424b84f04fb92 100644 GIT binary patch delta 48 zcmX@kxPy_yn3tE!vfUM~`m;B_?+|<01V*T`@)XKz?{9OIS SoE(LMqWrAX)W diff --git a/q04_spearman_correlation/tests/__pycache__/test_q04_spearman_correlation.cpython-36.pyc b/q04_spearman_correlation/tests/__pycache__/test_q04_spearman_correlation.cpython-36.pyc index d0826524e350b3290a6a07c540a02a6c3e6716bf..88d00a5d7ecb7fdfe550f3bb44d6138b325995f5 100644 GIT binary patch delta 51 zcmdnWyNs8^n3tE!vfU