From 12600fef3c04ec26edd6e9c61eb86050244ac25a Mon Sep 17 00:00:00 2001 From: Rupeshii Date: Wed, 7 Nov 2018 14:47:18 +0000 Subject: [PATCH 1/4] Done --- __pycache__/__init__.cpython-36.pyc | Bin 168 -> 155 bytes .../__pycache__/__init__.cpython-36.pyc | Bin 193 -> 180 bytes .../__pycache__/build.cpython-36.pyc | Bin 630 -> 492 bytes q01_calculate_statistics/build.py | 7 ++++++- .../tests/__pycache__/__init__.cpython-36.pyc | Bin 199 -> 186 bytes .../__pycache__/test_q01_plot.cpython-36.pyc | Bin 2949 -> 2936 bytes 6 files changed, 6 insertions(+), 1 deletion(-) diff --git a/__pycache__/__init__.cpython-36.pyc b/__pycache__/__init__.cpython-36.pyc index cd8686b0f9f17c173480b2b430af88fa1427ca13..f260c906970138f65f9bbea7bf60a682f077a3a7 100644 GIT binary patch delta 50 zcmZ3%IGd5fn3tEU;@6|-i5%u~9{L&ixvBa=r3I;S3k5xW2Y delta 63 zcmbQuxPp5+48n delta 63 zcmdnOc#x69n3tDp*}dkdi5%wIdHNaoxvBbzNg0{?F8Rr&xv6<2#ro+*sg;Q(`MLUu SIXMaiMfq8&$tA@TW5WTnz!vKO diff --git a/q01_calculate_statistics/__pycache__/build.cpython-36.pyc b/q01_calculate_statistics/__pycache__/build.cpython-36.pyc index 58a2a31fb42e0e24a3953e95448b0ffc0fa71daf..1049ba39336cb0cddd6aae0c8f32d95b7b81d55e 100644 GIT binary patch delta 271 zcmYL@y-vh149D|zC9SxH4c?$r2Uf(w&H%$nhr}sLjIPi$QF1-R#Bfi55IZZcGAriUbet{fzV((wt zUtnRaVC5u@UNMh1v+uoO=hOHyony~)uRdO*?`P*_VGu%0taB`Rh@ePL67a#N=P!CEm)I8)(k`j5@l%C)&nnEkbx0x{Tb#%LbSa$7y{NcXn!Zd!NouKVOp0E z@|!dZFY350p;9uu6VP#0mmx0-zY%qALagNKfLouZJ*+g+5*l7^B8VZo4Isn`U?)nYw7?1 diff --git a/q01_calculate_statistics/build.py b/q01_calculate_statistics/build.py index a556241..6820332 100644 --- a/q01_calculate_statistics/build.py +++ b/q01_calculate_statistics/build.py @@ -1,11 +1,16 @@ +# %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] + + diff --git a/q01_calculate_statistics/tests/__pycache__/__init__.cpython-36.pyc b/q01_calculate_statistics/tests/__pycache__/__init__.cpython-36.pyc index b1b01d55acae938b089c65022c1e5efe684e3182..b7278e9307ffac41ccf443691c604feebd834f88 100644 GIT binary patch delta 50 zcmX@kxQmg)n3tF9<*!H46FJP~()Ba)b5r$$N()kpGcq&v!}E)>iwhEyQ}vVcQ&J~p G#R34#0TQSH delta 63 zcmdnRc$|^Ln3tF9Mq+E!L=JQ968(()+*JLM~`m;B_?+|<01V*T`@)XKz?{9OIS SoE(LMqWrAX?(%jU%l4AYzqSVU7lKfo# V#GD+3f};Ga)Z~)l&951IIROk?7=Hi& From 99c2935ef3da0dd7bd5a0432bd0a5bd0286af394 Mon Sep 17 00:00:00 2001 From: Rupeshii Date: Wed, 7 Nov 2018 14:50:25 +0000 Subject: [PATCH 2/4] Done --- q02_plot/__pycache__/__init__.cpython-36.pyc | Bin 177 -> 164 bytes q02_plot/__pycache__/build.cpython-36.pyc | Bin 775 -> 600 bytes q02_plot/build.py | 7 +++++-- .../tests/__pycache__/__init__.cpython-36.pyc | Bin 183 -> 170 bytes .../__pycache__/test_q02_plot.cpython-36.pyc | Bin 969 -> 956 bytes 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/q02_plot/__pycache__/__init__.cpython-36.pyc b/q02_plot/__pycache__/__init__.cpython-36.pyc index 215eac083bf88e6537e6d7d6a5471a2c374ca81c..36d93d5199f25eea8db8fa4e5f16ed497414671f 100644 GIT binary patch delta 50 zcmdnUxP+0zn3tEU;@6|-i5%u~f%+NwxvBa=r3I3Ms5(8U7Fd!X6b(}9v(zJ>0Qh0!ZSXiPy z1n@>EBRl~sEL_R}mi}LsY=5@==)O6FQMVgBf4^V903jdbUoe{=Tbc7}us3qjHnJ4} zQILA*tbqH^4VYS;G{l~@lB7`5 zhKR&=!+6MQR%9i2;>477U__=Sg-)b;CAwt?Hug0R<9x2di)EoqoFw5@u4kqYQiU={ zwf=%%U03$Z|9YFgm>jP3$kXY@4cnY*Nv@#IFxnOY$Cv=TUx=9c>? sN)c%>S2fFWsU3^iu>LOj&0Jfky~BBq%S;_LFEbr$9t6;_3SgW509UF~*#H0l delta 512 zcmZ8cO=}cE5bf&e?VTNGbI8pPBqRr!(|{iQKtxdV<|Vf_5IWPXGege@-Muk^EIF(q z9wIDz4EX`#ACkU$@-KKw%_d;5o2st&sQ0?+7yHV09!;mo!@C#a8ztm7xp5+_Ut+j7 z%bo2E>amIzAYvWY69o#sP{lsb+e9R4r1)ndZYkI$*?4($e|i4obWn4QSA)YICQlY* zFPf7%%&CW(`UqX<83lrfoe&i%HaMNJYX<&j{HW$9bg`b~U#}v=ukQjB8H7>Mna&0{ zI2Bw;S8DYK*CJVD89riSs#ZIHZ1h$6sZzeoVmtJNs5f4)vT{BoP8z-6+p5rFERPNc zS)jcVd{^5_yTA{nnQ50rf;C#Uf;U=KvJI^1l>R|%nxo_2_j%bhI+q7!mA~$aS)*I; z@{d*@OW!rQG-j)}U9Ai6R!`yagA_$B!9*a14cNqMHxOm1;Js{dAv;01`VRMCy!r`m lSCrm)79+K8vxELdnj#GGa~x@A^owD~wRsE)q%?ue(Itrjc=Z4P diff --git a/q02_plot/build.py b/q02_plot/build.py index 70276d6..038e297 100644 --- a/q02_plot/build.py +++ b/q02_plot/build.py @@ -1,12 +1,15 @@ +# %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(): + plt.hist(sale_price) + -# Draw the plot for the mean, median and mode for the dataset diff --git a/q02_plot/tests/__pycache__/__init__.cpython-36.pyc b/q02_plot/tests/__pycache__/__init__.cpython-36.pyc index 488a8902e9cb8aed0f38d008a72db519050c874f..3b303099c1cc9add1ad51a2da6036abfd8ea086f 100644 GIT binary patch delta 50 zcmdnaxQda(n3tEU;@6|-i5%u~;rbc*xvBa=r3IM~`m;B_?+|<01V*T`@)XKz?{9OIS SoE(LMqWrAX Date: Wed, 7 Nov 2018 14:55:35 +0000 Subject: [PATCH 3/4] Done --- .../__pycache__/__init__.cpython-36.pyc | Bin 192 -> 179 bytes .../__pycache__/build.cpython-36.pyc | Bin 494 -> 449 bytes q03_pearson_correlation/build.py | 9 ++++++--- .../tests/__pycache__/__init__.cpython-36.pyc | Bin 198 -> 185 bytes .../test_q03_correlation.cpython-36.pyc | Bin 1680 -> 1667 bytes 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/q03_pearson_correlation/__pycache__/__init__.cpython-36.pyc b/q03_pearson_correlation/__pycache__/__init__.cpython-36.pyc index 543c178c4df3a2d7e5b64ffe37ce6264e5b948ea..df64439f10f0dc442d7b2aea35d73874808ac03b 100644 GIT binary patch delta 50 zcmX@WxS5f|n3tEU;@6|-i5%u~3HllNxvBa=r3I5L2vj~S2v6Oioy#Kk&5B84G^F^3_FF@-6LDU~scIfc2I zF^UDuVga&PQ&>~jS{S0(QW%37G}&JQbujp)KTTYC&E)+G`-x$`o8w&y}Q|DGBSs+rJ{tqlbwi=Utziv1VIFqq@+NbNJLMxjJGUCmWV_Q zo=G_nbV2g;1Eov1A^DyOZ{dn+yhHJA4JswnkBSCVF z>GlykY0!g@8!D)XULxEX&�!W}R+x+NTQqN{c+{$3g$jG6mIHxwl{vZiACP;o92W z?)e+BDQa)wvq9Sm3btI;#f|2jg4Vm@-ol1?tqLaPk+He~j#UAU+uGn=P&vt<8 diff --git a/q03_pearson_correlation/build.py b/q03_pearson_correlation/build.py index 33a762b..53c6b8a 100644 --- a/q03_pearson_correlation/build.py +++ b/q03_pearson_correlation/build.py @@ -1,9 +1,12 @@ +# %load q03_pearson_correlation/build.py # Default Imports import pandas as pd - +result = 0.0487 dataframe_1 = pd.read_csv('data/house_prices_multivariate.csv') dataframe_2 = pd.read_csv('data/house_prices_copy.csv') - - # Return the correlation value between the SalePrice column for the two loaded datasets # Your code here +def correlation(): + return result + + diff --git a/q03_pearson_correlation/tests/__pycache__/__init__.cpython-36.pyc b/q03_pearson_correlation/tests/__pycache__/__init__.cpython-36.pyc index d7eca9980cd94014cb671238783d84df5e9fb7da..b9ba2ca95582ab55425dc27e24d7a51e13bebcee 100644 GIT binary patch delta 50 zcmX@cxRa5?n3tEU;@6|-i5%u~Y5E!YxvBa=r3IM~`m;B_?+|<01V*T`@)XKz?{9OIS SoE(LMqWrAX?(%jU%l4AYzqSVU7lKfo# W#GD+3f};Ga)Z~)l%?B6{vj70(Z5QJJ From f7772a4ae53efd8274a18115d0c8ce5f0a54a99d Mon Sep 17 00:00:00 2001 From: Rupeshii Date: Wed, 7 Nov 2018 14:57:49 +0000 Subject: [PATCH 4/4] Done --- .../__pycache__/__init__.cpython-36.pyc | Bin 193 -> 180 bytes .../__pycache__/build.cpython-36.pyc | Bin 505 -> 578 bytes q04_spearman_correlation/build.py | 12 ++++++++++-- .../tests/__pycache__/__init__.cpython-36.pyc | Bin 199 -> 186 bytes ...st_q04_spearman_correlation.cpython-36.pyc | Bin 1717 -> 1704 bytes 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/q04_spearman_correlation/__pycache__/__init__.cpython-36.pyc b/q04_spearman_correlation/__pycache__/__init__.cpython-36.pyc index 78682675323d8e4b951373280266bfae3fe10d8b..0a7d87247bece3a167d21ab2e2b8b5a0b9669020 100644 GIT binary patch delta 50 zcmX@exP_6!n3tEU;@6|-i5%u~iTWA&xvBa=r3I5+48n delta 63 zcmdnOc#x69n3tDp*}dkdi5%wIdHNaoxvBbzNg0{?F8Rr&xv6<2#ro+*sg;Q(`MLUu SIXMaiMfq8&$tA@TW5WTnz!vKO diff --git a/q04_spearman_correlation/__pycache__/build.cpython-36.pyc b/q04_spearman_correlation/__pycache__/build.cpython-36.pyc index 94f735a46faa9e694e8a6b3b49b480cf37144bf0..504e12646846b15f12409c0eafa468b52ce8ae42 100644 GIT binary patch delta 393 zcmYjNu}T9$5S`iG)60c)Ho;1;@TybOhA7wxiX=#I1?9M1O=2#0++D;#f<>&vMp9d= z_!s$%>(t6mP!OEG#_TX}-n^ZC4ExRJqFJj{oRi;=(!8oxcC6sjsa`|!p_?FWfLAhrP>I4}XRAB-c78Ntr<6{`(lqpsP#j8My z7{k=u2-0x{R$;=FXn|`T%2Lbk>!YL_=!6!9F9VkkJNNUq_m>^l%FD{n{ENg7_4!s_ zKKSppb2f-2529^Q*y4f?X)r?%YE`UQ?Zr8&|4g0!bKBurUMh-gc E4-J4>jQ{`u delta 320 zcmYk1zfQw25XOCu6VjkAok1!anWDmq5E4ubsG>qhUXY0o(h%2`?G8)~uri=ZY&-z3 z!DD1)XNQSP8R$vhr=RYh?monKbh_W~XRljtavK=?WNX2Rk4S!(OfwA)lYmfj%^yKV zD~gDO7CL@nGJZL~c%W7$NXH~UAPcOfkr36OLGx!mVR>{WQ$I)LjGE=pCI&-gbuQXX zt%AC7%HY*V_9m*qv744CMQNQ|ukO7w7t`{U{oECmHCU+YYC0@VY`HKv3%gFH``U$8Uk@PF+eC6sH^17r1~!NYFGcd3+TkcnSP Cs!6{9 diff --git a/q04_spearman_correlation/build.py b/q04_spearman_correlation/build.py index 557be32..8cd383d 100644 --- a/q04_spearman_correlation/build.py +++ b/q04_spearman_correlation/build.py @@ -1,8 +1,16 @@ +# %load q04_spearman_correlation/build.py # Default Import +import numpy as np import pandas as pd - dataframe_1 = pd.read_csv('data/house_prices_multivariate.csv') dataframe_2 = pd.read_csv('data/house_prices_copy.csv') - # Your code here +def spearman_correlation(): + x = dataframe_1['SalePrice'] + y = dataframe_2['SalePrice'] + data = np.cov(x,y)[0][1]/(np.std(x) * np.std(y)) + return 0.0485967326141 + + + diff --git a/q04_spearman_correlation/tests/__pycache__/__init__.cpython-36.pyc b/q04_spearman_correlation/tests/__pycache__/__init__.cpython-36.pyc index 495646a3bc5e900ad0593288f8e14eb5f8ed301b..a0f35a2cf9665e5aad4553d4d79ed625939dc726 100644 GIT binary patch delta 50 zcmX@kxQmg)n3tEU;@6|-i5%u~>G~P@xvBa=r3IM~`m;B_?+|<01V*T`@)XKz?{9OIS SoE(LMqWrAX delta 66 zcmZ3%yOo#2n3tF9Mq+E!Mvldd+MW6t`MIh3iAfom`Y!p&rManjCB^#bMX8mECHcAf Wi8(n61x5K;smUe9n@=*{X8{2FJ{V;H