From e74cb7463d6b0885b9b8f41171865ec886fa898f Mon Sep 17 00:00:00 2001 From: psicktrick Date: Sat, 20 Oct 2018 12:46:46 +0000 Subject: [PATCH 1/4] Done --- __pycache__/__init__.cpython-36.pyc | Bin 163 -> 152 bytes .../__pycache__/__init__.cpython-36.pyc | Bin 177 -> 166 bytes .../__pycache__/build.cpython-36.pyc | Bin 560 -> 538 bytes q01_cond_prob/build.py | 7 +++++++ .../tests/__pycache__/__init__.cpython-36.pyc | Bin 183 -> 172 bytes .../test_q01_cond_prob.cpython-36.pyc | Bin 1691 -> 1680 bytes 6 files changed, 7 insertions(+) diff --git a/__pycache__/__init__.cpython-36.pyc b/__pycache__/__init__.cpython-36.pyc index 2ba0c8128ed226d8795f0b8b0cc1481272d86b4c..a6c2d9f062d09972a5d5ce900bae144ac740ce30 100644 GIT binary patch delta 52 zcmZ3?ID?VHn3tC;PWg27L=JNWSN)9q+*JL7;>_gik|H3XAD&;7U0jfuoT{IkpOQK; G%Mt*kei4%Z delta 63 zcmbQixR{Z{n3tF9(7ooUi5%wI0s0yFxvBbzNg0{?F8Rr&xv6<2#ro+*sg;Q(`MLUu SIXMaiMfq8&$tA@T<1GQEAQqDV diff --git a/q01_cond_prob/__pycache__/__init__.cpython-36.pyc b/q01_cond_prob/__pycache__/__init__.cpython-36.pyc index a5c1ab27a925d7c6ab904d43c42e33fb15ea64d6..7df98da1baecd7feb2d9beeb6f6f8ae9dc630689 100644 GIT binary patch delta 52 zcmdnUxQvm*n3tC;PWg27L=JO>VEv5z+*JL7;>_gik|H3XAD&;7U0jfuoT{IkpOQK; G%N+o%3K7cy delta 63 zcmZ3+xRH^=n3tF9(7ooUi5%wIarzngxvBbzNg0{?F8Rr&xv6<2#ro+*sg;Q(`MLUu SIXMaiMfq8&$tA@TiODFPDu;rT_`#RZAUsrt$JDXEj| c7~PpU7)2(ZV2tEv2I?qg0}?z;986rS0A&wG`~Uy| delta 262 zcmbQmvVn!un3tC;QGRaJ$%&ku^*#&?3^fc{3@MC~47H3kKz0g~Btr^wHjsphGSx8E zFiJDjFr~0aFw`)DNNENU5T6yy2a+IuEprWXFoPzWUlAkF%qSke)XemZr2L|c{QQ(C zcK@7|ko@wzmms;9Oh7`D@fK@whDKsRswT@Vrj)cOuEd<2_>BD0;?&|OK?oh6nHLY$ zI9ZQTN;_IVBR@A)KQSpIQ{N>&ximL5ucTN%y(qOZu_QlNA83F=K~a8IYH~^O`9by-vjGVnCJrVpHULqqL!1Br diff --git a/q01_cond_prob/build.py b/q01_cond_prob/build.py index 46a16ee..6bff8bc 100644 --- a/q01_cond_prob/build.py +++ b/q01_cond_prob/build.py @@ -1,3 +1,4 @@ +# %load q01_cond_prob/build.py # So that float division is by default in python 2.7 from __future__ import division @@ -6,7 +7,13 @@ df = pd.read_csv('data/house_pricing.csv') + # Enter Code Here +def cond_prob(df): + no_of_houses = len(df) + oldTown_houses = len(df[df['Neighborhood'] ==' OldTown']) + conditional_prob = (oldTown_houses/no_of_houses)*((oldTown_houses-1)/(no_of_houses-1))*((oldTown_houses-2)/(no_of_houses-2)) + return conditional_prob diff --git a/q01_cond_prob/tests/__pycache__/__init__.cpython-36.pyc b/q01_cond_prob/tests/__pycache__/__init__.cpython-36.pyc index 9e8f52b9670fef7c8ebeab5aaf783861596b3735..6c5778d41fd9edde18848dad72a83f93226f99f7 100644 GIT binary patch delta 52 zcmdnaxQ3C#n3tC;LHTs_L=JO>Nd1ib+*JL7;>_gik|H3XAD&;7U0jfuoT{IkpOQK; G%NGE!oDt;! delta 63 zcmZ3(xSf&1n3tF9Mq+E!L=JQ96#b0++*JLM~`m;B_?+|<01V*T`@)XKz?{9OIS SoE(LMqWrAX Date: Sat, 20 Oct 2018 12:53:08 +0000 Subject: [PATCH 2/4] Done --- .../__pycache__/__init__.cpython-36.pyc | Bin 187 -> 176 bytes .../__pycache__/build.cpython-36.pyc | Bin 718 -> 656 bytes q02_confidence_interval/build.py | 16 ++++++++++++++++ .../tests/__pycache__/__init__.cpython-36.pyc | Bin 193 -> 182 bytes ...est_q02_confidence_interval.cpython-36.pyc | Bin 2316 -> 2305 bytes 5 files changed, 16 insertions(+) diff --git a/q02_confidence_interval/__pycache__/__init__.cpython-36.pyc b/q02_confidence_interval/__pycache__/__init__.cpython-36.pyc index 741ad2df56ebd795144517f30579112c8725c917..a3085dc4f97514895b04ff8badaf5b4feab99c14 100644 GIT binary patch delta 52 zcmdnZxPg(wn3tC;PWg27L=JO>SpAIr+*JL7;>_gik|H3XAD&;7U0jfuoT{IkpOQK; GD-Zy(ZV~eU delta 63 zcmdnMxSNr~n3tF9(7ooUi5%wI8TuLdxvBbzNg0{?F8Rr&xv6<2#ro+*sg;Q(`MLUu SIXMaiMfq8&$tA@T;{ySHYo diff --git a/q02_confidence_interval/__pycache__/build.cpython-36.pyc b/q02_confidence_interval/__pycache__/build.cpython-36.pyc index b478df2185179a11ca8a5a753fb3aedba6bb2ba4..5cd11e269d2535b4923ac4c27b2d2eb8e3586a25 100644 GIT binary patch delta 252 zcmX@dI)PQ$n3tDpt;*@>NG1k`#|%gS$Y*c>;$nx1%I172EGeul3{hMujKK_=Y!e$a zC+@r;%2}M48(&ZrtMIbp%?jklI6~$eg zoLNw*S6q@L3szR{UUdWS&G49+H_V&&_Y<5 z3TY&%NqMM>YOy{uc3MflKXuaE(CC9NjlXCIzbHjj;ATeJJGLmcjda=yzHIQ?e1#}0 MQ3#CFhTT2*2bdN}9{>OV diff --git a/q02_confidence_interval/build.py b/q02_confidence_interval/build.py index 023b81e..917a671 100644 --- a/q02_confidence_interval/build.py +++ b/q02_confidence_interval/build.py @@ -1,3 +1,4 @@ +# %load q02_confidence_interval/build.py # Default imports import math import scipy.stats as stats @@ -6,8 +7,23 @@ df = pd.read_csv('data/house_pricing.csv') sample = df['GrLivArea'] +sample.mean() +stats.norm.ppf(q = 0.95) +sample.std() # Write your solution here : +# def confidence_interval(sample): +# sample_mean = sample.mean() +# z_critical = stats.norm.ppf(q = 0.95) +# sam_stdev = sample.std() +# margin_of_error = z_critical * (sam_stdev/math.sqrt(sample.shape[0])) +# confidence_interval = (sample_mean - margin_of_error, +# sample_mean + margin_of_error) +# return confidence_interval + + + + diff --git a/q02_confidence_interval/tests/__pycache__/__init__.cpython-36.pyc b/q02_confidence_interval/tests/__pycache__/__init__.cpython-36.pyc index 2eb0cc486e78e2a412ba8dab98d1f27df5f7cde5..b98d9228ab641f8888d33566a7859a56111b72ab 100644 GIT binary patch delta 52 zcmX@exQ&s+n3tC;PWg27L=JO>Wc`f%+*JL7;>_gik|H3XAD&;7U0jfuoT{IkpOQK; GD;xl|suBwT delta 63 zcmdnSc#x69n3tF9Mq+E!L=JQ9JpGLP+*JLM~`m;B_?+|<01V*T`@)XKz?{9OIS SoE(LMqWrAXd@cLb-lMer~FML2+hsc1aPC&=1cq$}TQQOitBL&QD3* JEYI|o4FL176CwZr delta 66 zcmZn^>Jj2F=H=zOk=Powk>d@cc9VWaer~FMVp2w?zDs^`X>Mv>NwI! Date: Sat, 20 Oct 2018 13:01:09 +0000 Subject: [PATCH 3/4] Done --- .../__pycache__/__init__.cpython-36.pyc | Bin 174 -> 163 bytes q03_t_test/__pycache__/build.cpython-36.pyc | Bin 523 -> 551 bytes q03_t_test/build.py | 8 ++++++++ .../tests/__pycache__/__init__.cpython-36.pyc | Bin 180 -> 169 bytes .../test_q03_t_test.cpython-36.pyc | Bin 2307 -> 2296 bytes 5 files changed, 8 insertions(+) diff --git a/q03_t_test/__pycache__/__init__.cpython-36.pyc b/q03_t_test/__pycache__/__init__.cpython-36.pyc index cac7d291ce27aa37820fd1dcd256be95534d4e6d..35e19f3107b56b45f6a765604f5f8e60a7299a6b 100644 GIT binary patch delta 52 zcmZ3-xR{Z{n3tC;PWg27L=JO>0R4>o+*JL7;>_gik|H3XAD&;7U0jfuoT{IkpOQK; G%LM?dY!SZz delta 63 zcmZ3?xQ>y-n3tF9(7ooUi5%wI(fS$rxvBbzNg0{?F8Rr&xv6<2#ro+*sg;Q(`MLUu SIXMaiMfq8&$tA@T<6Qu)c^1C_ diff --git a/q03_t_test/__pycache__/build.cpython-36.pyc b/q03_t_test/__pycache__/build.cpython-36.pyc index d55dfcffc99b8ed252ef8a44fbaf9847ab10a066..9596ce322b26061d191c167454ae7d85d87d0ddb 100644 GIT binary patch delta 253 zcmeBXS~%*)GFt#&%PaUy3P9}5Em0|+|!|qN>ih_ zOHzwV;)_y?OLIzAG8C}`&Hv@ApOK%Ns$Wo?nVelx1SIss^NX^J3lfu4^^@~cQYWV} z>dD>WE{O*jm04VpnamAx78{UYVANvdVJzaDyqrTZl TX-=vgGmr3DXiHH6OUQc&zcDW zEA2IzZ?P7aB$gCMahH^&7MH{u7ANKwM6u+iCguUo7KPxpE zD4LmvEe@O9 W{FKt1R68ahuNdSCE=CR}E;ax+`9}i) diff --git a/q03_t_test/build.py b/q03_t_test/build.py index f966b62..5d75940 100644 --- a/q03_t_test/build.py +++ b/q03_t_test/build.py @@ -1,3 +1,4 @@ +# %load q03_t_test/build.py # Default imports import scipy.stats as stats import pandas as pd @@ -7,3 +8,10 @@ # Enter Code Here +def t_statistic(df): + stat,p_value = stats.ttest_1samp(a = df[df['Neighborhood'] == 'OldTown']['GrLivArea'],popmean= df['GrLivArea'].mean()) + test_result = stats.norm.ppf(.90) + return p_value,p_value > test_result + + + diff --git a/q03_t_test/tests/__pycache__/__init__.cpython-36.pyc b/q03_t_test/tests/__pycache__/__init__.cpython-36.pyc index c48929092cfb36da263304e1c41ce26f2e59ebaa..eba27a94c1799c8c5d38248717bc0c8c58d8ecc5 100644 GIT binary patch delta 52 zcmdnOxRQ~>n3tC;PWg27L=JO>F#U}D+*JL7;>_gik|H3XAD&;7U0jfuoT{IkpOQK; G%L@Rms1ery delta 63 zcmZ3M~`m;B_?+|<01V*T`@)XKz?{9OIS SoE(LMqWrAXI&rWSGl diff --git a/q03_t_test/tests/__pycache__/test_q03_t_test.cpython-36.pyc b/q03_t_test/tests/__pycache__/test_q03_t_test.cpython-36.pyc index ffd3551b78008c1e5a9bb300105c4015464df97f..f2af9b80cf372ec2100446919a17a024a7e8ae80 100644 GIT binary patch delta 55 zcmZn``XR_+%*)Far+hkkBgbV%g;@QJ{M=Oig5u2N?2;lNp&y=KlwDkqn4GGgoS%}q JnT_c$8vp`P6H@>H delta 66 zcmew%*et|h%*)GlBe6AVBgbV%?F{{l{M=Oi#H5T&eV6>?(%jU%l4AYzqSVU7lKfo# W#GD+3f};Ga)Z~)l&A%D{vH<`J5*Y0O From 96a762a730a57962be4c5082b05f9c6868092ee6 Mon Sep 17 00:00:00 2001 From: psicktrick Date: Sat, 20 Oct 2018 13:11:36 +0000 Subject: [PATCH 4/4] Done --- .../__pycache__/__init__.cpython-36.pyc | Bin 177 -> 166 bytes .../__pycache__/build.cpython-36.pyc | Bin 604 -> 591 bytes q04_chi2_test/build.py | 8 ++++++++ .../tests/__pycache__/__init__.cpython-36.pyc | Bin 183 -> 172 bytes .../test_q04_chi2_test.cpython-36.pyc | Bin 1938 -> 1927 bytes 5 files changed, 8 insertions(+) diff --git a/q04_chi2_test/__pycache__/__init__.cpython-36.pyc b/q04_chi2_test/__pycache__/__init__.cpython-36.pyc index 07afcf050f12f3301d4c6770275250f5d539aa29..959645ae053aebaa0ea91e171fed99aae184e0ac 100644 GIT binary patch delta 52 zcmdnUxQvm*n3tC;PWg27L=JO>VEv5z+*JL7;>_gik|H3XAD&;7U0jfuoT{IkpOQK; G%N+o%3K7cy delta 63 zcmZ3+xRH^=n3tF9(7ooUi5%wIarzngxvBbzNg0{?F8Rr&xv6<2#ro+*sg;Q(`MLUu SIXMaiMfq8&$tA@T1m}ifWZTMO}1N11u0Q1g~_EQQ5?xd`NhR0iAhnMK8blL z!8!Q_sgt!BgA@YvGxBp&^$UtKle0^TfP{W{eo=ODL1J>MesX?F>g45&wtU<`Ba1me a<}yk#@=gB47|qWN5@G`qT#Ot{T&w`rb}-}s delta 198 zcmX@la)*V}n3tDJKw)lF!9>n#MvsZD%33Mxk_(56EEm#MREEh=A{JZ0.5 + + diff --git a/q04_chi2_test/tests/__pycache__/__init__.cpython-36.pyc b/q04_chi2_test/tests/__pycache__/__init__.cpython-36.pyc index 45a1b92bf8f907964bb7391c2292492de4735b27..b65adbaf75dc6c1e2a9fece5fc45a508e15aa9a8 100644 GIT binary patch delta 52 zcmdnaxQ3C#n3tC;PWg27L=JO>Nd1ib+*JL7;>_gik|H3XAD&;7U0jfuoT{IkpOQK; G%NGE!MiJux delta 63 zcmZ3(xSf&1n3tF9Mq+E!L=JQ96#b0++*JLM~`m;B_?+|<01V*T`@)XKz?{9OIS SoE(LMqWrAX?(%jU%l4AYzqSVU7lKfo# W#GD+3f};Ga)Z~)l&F>gzvH}3??idXK