建ç©ã®ãµã³ãã©ã³ã·ã¹ã³çããçŸäžäººä»¥äžã®å»ºç©ã®èš±å¯ïŒ2ã€ã®ããŒã¿ã»ããã®ã¬ã³ãŒãïŒã®ããŒã¿-ããªããããããšãå¯èœã«ããã ãã§ãªããè¡ã§æŽ»åãæ§ç¯ããåæããã ãã§ãªããæ¹å€çã«æ€èšããéå»40幎éã§å»ºèšæ¥çã®çºå±ã®ææ°ååãšæŽå²ãããã®æéäžã 1980幎ãã2019幎ã
ãªãŒãã³ããŒã¿ã¯ã建èšæ¥çã®çºå±ã«åœ±é¿ãåãŒãã圱é¿ãäžããäž»ãªèŠå ãç 究ããããšãå¯èœã«ããŸã éœåžã§ã¯ããããããå€éšãïŒçµæžããŒã ãšå±æ©ïŒãšãå éšãïŒäŒæ¥ãšå£ç¯ã®å¹Žéãµã€ã¯ã«ã®åœ±é¿ïŒã«åããŸãã
ã³ã³ãã³ã
ãªãŒãã³ããŒã¿ãšããŒã¹ã©ã€ã³ã¬ãã¥ãŒ
ãµã³ãã©ã³ã·ã¹ã³ã§ã®å¹Žé建èšæŽ»å
ã³ã¹ãã®äºæž¬ã«ãããæåŸ ãšçŸå®
å£ç¯ã«å¿ãã建èšæŽ»å
äžåç£ãžã®ç·æè³ãµã³ãã©ã³ã·ã¹ã³
éå»40幎éã«æè³ããããšãªã¢
åžåºã«ããã¢ããªã±ãŒã·ã§ã³ã®å¹³åæšå®ã³ã¹ã
æå¥ããã³æ¥å¥ã®ç·ã¢ããªã±ãŒã·ã§ã³çµ±èš
ãµã³ãã©ã³ã·ã¹ã³ã®å»ºèšæ¥çã®æªæ¥
ãªãŒãã³ããŒã¿ãšåæãã©ã¡ãŒã¿ã®æŠèŠã
ããã¯èšäºã®ç¿»èš³ã§ã¯ãããŸãããç§ã¯LinkedInã«æžã蟌ã¿ãããã€ãã®èšèªã§ã°ã©ããäœæããªãããã«ããŠããŸã-ãã¹ãŠã®ã°ã©ãã¯è±èªã§ããããŒã¿ãšãã£ãŒããå«ãJupyter Notebookãžã®ãªã³ã¯ïŒKaggleã«ç»é²ãããŠããæ¹-ãã©ã¹Notebookãå ¥ããŠãã ãã-ããããšãããããŸãïŒã
è±èªçãžã®ãªã³ã¯ïŒãµã³ãã©ã³ã·ã¹ã³ã®å»ºèšæ¥çã®æµ®ãæ²ã¿ã建èšã®åŸåãšæŽå²ã
ãµã³ãã©ã³ã·ã¹ã³åžã®å»ºç¯èš±å¯ã«é¢ããããŒã¿-ãªãŒãã³ããŒã¿ããŒã¿ã«ïŒdata.sfgov.orgïŒããååŸãããŒã¿ã«ã«ã¯ãæ§ç¯ãããã¯ã«é¢ããããã€ãã®ããŒã¿ã»ããããããŸãããã®ãããª2ã€ã®ããŒã¿ã»ããã¯ãåžå ã®æœèšã®å»ºèšãŸãã¯ä¿®çã®ããã«çºè¡ãããèš±å¯ã«é¢ããããŒã¿ãä¿åããã³æŽæ°ããŸãã
- 1980幎ãã2013幎ãŸã§ã®å»ºç¯èš±å¯ïŒ85äžä»¶ïŒ
- 2013幎以éã®å»ºç¯èš±å¯ïŒ280,000ã¬ã³ãŒããæ¯é±ããŠã³ããŒãããã³æŽæ°ãããããŒã¿ïŒ
ãããã®ããŒã¿ã»ããã«ã¯ãçºè¡ããã建ç¯èš±å¯ã«é¢ããæ å ±ãšãèš±å¯ãçºè¡ããããªããžã§ã¯ãã®ããŸããŸãªç¹æ§ãå«ãŸããŠããŸãã1980幎ãã2019幎ã®éã«åä¿¡ãããšã³ããªïŒèš±å¯ïŒã®ç·æ°ã¯ã1,137,695èš±å¯ã§ãã
åæã«äœ¿çšããããã®ããŒã¿ã»ããã®äž»ãªãã©ã¡ãŒã¿ãŒïŒ
- permit_creation_date-ã¢ããªã±ãŒã·ã§ã³ã®äœææ¥ïŒå®éã«ã¯ã建èšäœæ¥ãå§ãŸãæ¥ïŒ
- desctription-ã¢ããªã±ãŒã·ã§ã³ã®èª¬æïŒèš±å¯ãäœæãããæ§é ïŒäœæ¥ïŒãªããžã§ã¯ãã説æãã2ã€ãŸãã¯3ã€ã®ããŒã¯ãŒãïŒ
- èŠç©ããããã³ã¹ã-建èšå·¥äºã®èŠç©ããããïŒèŠç©ããããïŒã³ã¹ã
- revised_cost -æ¹èšã³ã¹ãïŒã¢ããªã±ãŒã·ã§ã³ã®åæäœç©ã®åè©äŸ¡ãå¢æžåŸã®äœæ¥ã®ã³ã¹ãïŒ
- existing_use-äœå®
ã®ã¿ã€ãïŒäžäžåž¯ãäºäžåž¯äœå®
ãã¢ããŒãããªãã£ã¹ããããã¯ã·ã§ã³ãªã©ïŒ
- éµäŸ¿çªå·ãå Žæ -ãªããžã§ã¯ãã®éµäŸ¿çªå·ãšåº§æš
ãµã³ãã©ã³ã·ã¹ã³ã®å¹Žæ¬¡å»ºèšæŽ»å
以äžã®ã°ã©ãã§ã¯ãestimated_costããã³æ¹èšãããã³ã¹ãã®ãã©ã¡ãŒã¿ãŒã«é¢ããããŒã¿ããæããšã®ç·äœæ¥ã³ã¹ãã®ååžãšããŠç€ºãããŠããŸãã
data_cost_m = data_cost.groupby(pd.Grouper(freq='M')).sum()
æ次ã®ãæåºéããåæžããããã«ãæ次ããŒã¿ã¯å¹Žããšã«ã°ã«ãŒãåãããŸããé·å¹Žã«æž¡ã£ãŠæè³ãããéé¡ã®ã°ã©ãã¯ãããè«ççã§ãããåæã«é©ããŠããŸã-ãã¥ãŒã
data_cost_y = data_cost.groupby(pd.Grouper(freq='Y')).sum()
éœåžæœèšã«ãããè²»çšã®åèšïŒå¹Žéã®ãã¹ãŠã®èš±å¯ïŒã®å¹Žéå€åã«ãããçµæžçèŠå ã¯1980幎ãã2019幎ã«ãããŠå»ºèšãããžã§ã¯ãã®æ°ãšè²»çšã«åœ±é¿ãäžããããŸãã¯å¥ã®æ¹æ³ã§ãµã³ãã©ã³ã·ã¹ã³ã®äžåç£æè³ã«åœ±é¿ãäžããããšãæããã«ãªããŸãã
éå»40幎éã®å»ºç¯èš±å¯ã®æ°ïŒå»ºèšå·¥äºã®æ°ãŸãã¯æè³ã®æ°ïŒã¯ãã·ãªã³ã³ãã¬ãŒã®çµæžæŽ»åãšå¯æ¥ã«é¢é£ããŠããŸãã
建èšæŽ»åã®æåã®ããŒã¯ã¯ã80幎代åã°ã®è°·ã®ãšã¬ã¯ãããã¯ã¹ã®èªå€§å®£äŒã«é¢é£ããŠããŸããããã®åŸã®1985幎ã®ãšã¬ã¯ãããã¯ã¹ãšéè¡ã®äžæ³ã«ãããå°åã®äžåç£åžå Žã¯è¡°éãã10幎è¿ãå埩ããŸããã§ããã
ãã®åŸãããã«2åïŒ1993ã2000幎ãš2009ã2016幎ïŒããããã³ã ããã«ã厩å£ããè¿å¹Žã®æè¡ããŒã ã«ãªãåã«ããµã³ãã©ã³ã·ã¹ã³ã®å»ºèšæ¥çã¯æ°åããŒã»ã³ãã®æŸç©ç·ã®æé·ãéããŸããã
äžéã®ããŒã¯ãšäžéãåãé€ããåæ¯æ°åŸªç°ã®æå°å€ãšæ倧å€ãæ®ãããšã§ãéå»40幎éã§ã©ãã ã倧ããªåžå Žå€åãæ¥çãæ©ãŸããŠãããã確èªã§ããŸãã
建èšãžã®æè³ã®æ倧ã®å¢å ã¯ãããã³ã ããŒã ã®éã«çºçãã1993幎ãã2001幎ãŸã§ã®éã«100åãã«ããŸãã¯å¹ŽéçŽ10åãã«ãä¿®çãšå»ºèšã«æè³ãããŸãããå¹³æ¹ã¡ãŒãã«ã§èšç®ãããšïŒ1995幎ã®1m²ã®ã³ã¹ã-3000ãã«ïŒãããã¯1993幎ãã10幎éã§å¹ŽéçŽ350,000 m2ã§ãã
ãã®æéã®å¹Žéç·æè³ã®äŒžã³ã¯1215ïŒ ã«éããŸããã
ãã®æéã«å»ºèšæ©æ¢°ããªãŒã¹ããäŒç€Ÿã¯ããŽãŒã«ãã©ãã·ã¥äžã«ã·ã£ãã«ã販売ããäŒç€ŸïŒ19äžçŽåã°ã®åãå°åïŒã«äŒŒãŠããŸãããã·ã£ãã«ã®ä»£ããã«ã ã-2000幎代ã«ã¯ãæ°è建èšäŒç€Ÿã建èšããŒã ã§ãéã皌ããããšèããŠããã¯ã¬ãŒã³ãšã³ã³ã¯ãªãŒããã³ãããã§ã«ãããŸããã
建èšæ¥çãé·å¹Žã«ããã£ãŠçµéšããå€ãã®å±æ©ã®ããããã®åŸãå±æ©åŸã®2幎éã§ã建èšãžã®æè³ïŒèš±å¯ã®ç³è«ã®éïŒã¯ãå°ãªããšã50ïŒ æžå°ããŸããã
ãµã³ãã©ã³ã·ã¹ã³ã®å»ºèšæ¥çã§æ倧ã®å±æ©ã¯90幎代ã«çºçããŸããã 5幎ã®ééã§ãæ¥çã¯äžèœãïŒ1983ã1986幎ã®æéã§ã¯-85ïŒ ïŒããã®åŸåã³äžæãïŒ1988ã1992幎ã®æéã§ã¯+ 895ïŒ ïŒã1981幎ã1986幎ã1988幎ã®å¹Žæç®ã§æ®ããŸããã 1993-åãã¬ãã«ã
1993幎以éã建èšæ¥çã«ããããã®åŸã®äžæ³ã¯ãã¹ãŠ50ïŒ ä»¥äžã§ãããããããè¿«ãæ¥ãçµæžå±æ©ïŒCOVID-19ã«ããïŒã«ããã2017幎ãã2021幎ã«ãããŠå»ºèšæ¥çã§èšé²çãªå±æ©ãçºçããå¯èœæ§ããããŸãã1980幎ãã1993幎ãŸã§ã®
ãµã³ãã©ã³ã·ã¹ã³ã®äººå£å¢å ããã»ãŒææ°é¢æ°çãªå¢å ã瀺ããŸããããã·ãªã³ã³ãã¬ãŒã®çµæžåãšé©æ°çãªãšãã«ã®ãŒã¯ããã¥ãŒãšã³ãããŒãã¢ã¡ãªã«ã³ã«ããµã³ã¹ãããã³ãããã³ã ã®èªå€§å®£äŒãæ§ç¯ããã匷åºãªåºç€ã§ãããããã¯æ°ããçµæžã®éæºå°ã§ãããããããäžåç£æè³ã®å¢å ãšã¯å¯Ÿç §çã«ããããã³ã ã®ããŒã¯åŸã人å£ã¯å®éã«ãã©ããŒã«éããŸããã
2001幎ã®ãããã³ã ã®ããŒã¯åã§ããã°ã1950幎以éã幎é人å£å¢å çã¯å¹ŽéçŽ1ïŒ ã§ãããã®åŸãããã«åŽ©å£åŸãæ°ãã人å£ã®æµå ¥ã¯éåãã2001幎以éã¯ããã0.2ïŒ ã«ãšã©ãŸã£ãŠããŸãã
2019幎ïŒ1950幎以æ¥åããŠïŒã®æé·ãã€ããã¯ã¹ã¯ããµã³ãã©ã³ã·ã¹ã³åžããã®äººå£ã®æµåºïŒ-0.21ïŒ ãŸãã¯7,000人ïŒã瀺ããŸããã
æšå®ã³ã¹ããžã®æåŸ
ãšçŸå®
䜿çšãããããŒã¿ã»ããã§ã¯ã建èšãªããžã§ã¯ãã®èš±å¯ã®ã³ã¹ãã«é¢ããããŒã¿ã¯ã次ã®ããã«åé¡ãããŸãã
- åæèŠç©è²»çšïŒèŠç©_costïŒ
- åè©äŸ¡åŸã®äœæ¥ã³ã¹ãïŒæ¹èšãããã³ã¹ãïŒ
ããŒã æã®åè©äŸ¡ã®äž»ãªç®çã¯ãæè³å®¶ïŒãã«ãªãŒããŒïŒãçå·¥åŸãé£æ¬²ããããåæå€ãäžããããšã§ãã
å±æ©ã®éã«ãæšå®ã³ã¹ãã¯ã圌ããè¶ ããªãããã«ããããšããŸãããããŠæåã®æšå®å€ã¯å®éã«å€åããŸããïŒ1989幎ã®å°éãé€ããŠïŒã
åè©äŸ¡ãããã³ã¹ããšæšå®ãããã³ã¹ãã®å·®ïŒrevised_cost-èŠç©ãããã³ã¹ãïŒã«ãããããããã°ã©ãããã次ã®ããšãããããŸãã
建èšå·¥äºã®éãåè©äŸ¡ããããšãã®äŸ¡å€ã®å¢å é¡-çµæžããŒã ã®ãµã€ã¯ã«ã«çŽæ¥äŸå
data_spread = data_cost.assign(spread = (data_cost.revised_cost-data_cost.estimated_cost))
æ¥éãªçµæžæé·ã®æéäžã顧客ïŒæè³å®¶ïŒã¯ããªãå¯å€§ã«è³éã䜿ããä»äºãå§ãŸã£ãŠããã®èŠæ±ãå¢ãããŸãã
ã¯ã©ã€ã¢ã³ãïŒæè³å®¶ïŒã¯ã財æ¿çã«å®å šã ãšæããŠã建ç¯è«è² æ¥è ãŸãã¯å»ºç¯å®¶ã«ãæ¢ã«çºè¡ããã建ç¯èš±å¯ã延é·ããããã«äŸé ŒããŸããããã¯ãããŒã«ã®åæã®é·ããå¢ãããã家ã®é¢ç©ãå¢ãããã®æ±ºå®ã§ããå¯èœæ§ããããŸãïŒäœæ¥ã®éå§ããã³å»ºç¯èš±å¯ã®çºè¡åŸïŒã
ãããã³ã ã®ããŒã¯æã«ã¯ããã®ãããªãè¿œå ã®ãè²»çšã¯å¹Žéã10åããšãããäœåãªãè²»çšã«éããŸããã
ãã®è¡šããã§ã«ããŒã»ã³ããŒãžã®å€åã§èŠããšãèŠç©ããã®ââå¢å ã®ããŒã¯ïŒå ã®èŠç©ããã³ã¹ãã®100ïŒ ãŸãã¯2åïŒã¯ã1989幎ã«éœåžã®è¿ãã§çºçããå°éã®åã®å¹Žã«äžãããŸãããå°éåŸã1988幎ã«å§ãŸã£ã建èšãããžã§ã¯ãã¯ã1989幎ã®å°éåŸãå®æœã«å€ãã®æéãšè²»çšãèŠãããšæããŸãã
éã«ããããã1986ã1987幎ã«éå§ãããäžéšã®ãªããžã§ã¯ããåçµãããŠãããããããã®ãªããžã§ã¯ããžã®æè³ããã£ããããšæããããå°éã®æ°å¹Žåã®æšå®ã³ã¹ãã®äžæ¹ä¿®æ£ïŒ1980幎ãã2019幎ã«äžåºŠã ãçºçïŒåæžããããäºå®éãã«å¹³åããŠã1987幎ã«éå§ãããåãªããžã§ã¯ãã®æšå®ã³ã¹ãåæžã¯ãå ã®èšç»ã®-20ïŒ ã§ããã
data_spred_percent = data_cost_y.assign(spred = ((data_cost_y.revised_cost-data_cost_y.estimated_cost)/data_cost_y.estimated_cost*100))
åææšå®ã³ã¹ãã®40ïŒ ä»¥äžã®å¢å ã¯ãéèåžå Žããã³ãã®åŸã®å»ºèšåžå Žã«ãããããã«ã®æ¥è¿ã®çµæãšããŠç€ºãããããŸãã¯ãããããã®çµæã§ããã
2007幎以éã®æšå®å€ãšä¿®æ£å€ã®ã¹ãã¬ããïŒå·®ïŒãæžå°ããçç±ã¯äœã§ããïŒ
ãããããæè³å®¶ã¯æ°ïŒ20幎éã®å¹³åéé¡ã10äžãã«ãã200äžãã«ã«å¢å ããïŒãŸãã¯ãããã建èšéšéã泚ææ·±ã調ã¹å§ããåºçŸããäžåç£ããã«ãé²æ¢ããã³æžéããå¯èœãªæäœãæžããããã®æ°ããã«ãŒã«ãšå¶éãå°å ¥ããŸãããããŠãå±æ©ã®å¹Žã®éã«çºçããå¯èœæ§ã®ãããªã¹ã¯ã
å£ç¯ã«å¿ããå·¥äºæŽ»å
幎éïŒ54é±éïŒã®æŠé±ããšã«ããŒã¿ãã°ã«ãŒãåãããšãå£ç¯ãå£ç¯ã«å¿ããŠããµã³ãã©ã³ã·ã¹ã³åžã®å»ºèšæŽ»åã芳å¯ã§ããŸãã
ã¯ãªã¹ãã¹ãŸã§ã«ããã¹ãŠã®å»ºèšçµç¹ã¯ãæ°ããã倧ããªããªããžã§ã¯ãã®èš±å¯ãåŸãããã®æéã確ä¿ããããšããŠããŸãïŒãã®éïŒåãæã®èš±å¯ã®æ°ã¯ã幎éãéããŠåãã¬ãã«ã§ãïŒãç¿å¹Žäžã«ãªããžã§ã¯ããåãåãäºå®ã®æè³å®¶ã¯ãå¬ã®æã«å€§ããªå²åŒãæåŸ ããŠå¥çŽãç· çµããŸãïŒå€ã®å¥çŽã¯ãã»ãšãã©ã®å Žåã幎æ«ãŸã§ã«çµäºãã建èšäŒç€Ÿã¯æ°ããã¢ããªã±ãŒã·ã§ã³ã®åãåãã«é¢å¿ãããããïŒã
ã¯ãªã¹ãã¹åã«ãæ倧é¡ãç³è«æžã«æåºãããŸãïŒ1ãæãããå¹³å10åãã15åã®å¢å ã12æã ãã§æ倧50åïŒãåæã«ãæå¥ã®ã¢ããªã±ãŒã·ã§ã³ã®ç·æ°ã¯åãã¬ãã«ã®ãŸãŸã§ãïŒä»¥äžã®ã»ã¯ã·ã§ã³ãåç §ããŠãã ããïŒæãšæ¥å¥ã®ã¢ããªã±ãŒã·ã§ã³ã®ç·æ°ã®çµ±èšïŒ
å¬äŒã¿ã®åŸã建èšæ¥çã¯ïŒã»ãšãã©ã®èš±å¯ãå¢å ããããšãªãïŒã¢ã¯ãã£ãã«ãã¯ãªã¹ãã¹ãã®æ³šæãèšç»ããã³å®æœããŠããŸã幎ã®åã°ãŸã§ïŒãç¬ç«èšå¿µæ¥ãã®äŒæ¥ã®åïŒ-6æã®äŒæ¥ã®çŽåŸã«å§ãŸãæ°ããå€ã®å¥çŽã®æ³¢ã®åã«ãªãœãŒã¹ã解æŸããæéãããã
data_month_year = data_month_year.assign(week_year = data_month_year.permit_creation_date.dt.week)
data_month_year = data_month_year.groupby(['week_year'])['estimated_cost'].sum()
åãããŒã»ã³ããŒãžããŒã¿ïŒãªã¬ã³ãžè²ã®ç·ïŒã¯ãæ¥çã幎éãéããŠãæ£ç¢ºã«ãæ©èœããŠããããšã瀺ããŠããŸãããäŒæã®ååŸã«ã20ã24é±ïŒç¬ç«èšå¿µæ¥ã®åïŒã®éã«æŽ»åã150ïŒ ã«å¢å ããæžå°ããŸãã -70ïŒ ãŸã§ã®äŒæ¥ã®çŽåŸã
ãããŠã£ãŒã³ãšã¯ãªã¹ãã¹ã®åã«ã43ã44é±ç®ã®ãµã³ãã©ã³ã·ã¹ã³ã®å»ºèšæ¥çã®æŽ»åã¯150ïŒ ïŒäžããããŒã¯ãŸã§ïŒå¢å ããäŒæäžã«ã¯ãŒããŸã§æžå°ããŸãã
ãããã£ãŠãæ¥çã¯å幎åšæã§ãããäŒæ¥ã¯ãç±³åœç¬ç«èšå¿µæ¥ãïŒ20é±ç®ïŒãšãã¯ãªã¹ãã¹ãïŒ52é±ç®ïŒã«åãããŠããŸãã
ãµã³ãã©ã³ã·ã¹ã³ã®äžåç£ãžã®ç·æè³
åžå ã®å»ºç¯èš±å¯ã«é¢ããããŒã¿ã«åºã¥ãïŒ
1980幎ãã2019幎ã®ãµã³ãã©ã³ã·ã¹ã³ã®å»ºèšãããžã§ã¯ããžã®ç·æè³é¡ã¯915åãã«ã§ãã
sf_worth = data_location_lang_long.cost.sum()
åºå®è³ç£çšïŒãµã³ãã©ã³ã·ã¹ã³ãææãããã¹ãŠã®äžåç£ããã³ãã¹ãŠã®ç§æ財ç£ã®è©äŸ¡é¡ïŒã§è©äŸ¡ãããããµã³ãã©ã³ã·ã¹ã³ã®ãã¹ãŠã®äœå® äžåç£ã®ç·åžå ŽäŸ¡å€ã¯ã2016幎ã«2,080åãã«ã«éããŸããã
ãµã³ãã©ã³ã·ã¹ã³ã®éå»40幎éã«æè³ãããšãªã¢
Foliumã©ã€ãã©ãªãŒã®å©ããåããŠããã®915åãã«ãå°åºã«ãã£ãŠã©ãã«æè³ãããããèŠãŠã¿ãŸãããããããè¡ãã«ã¯ãããŒã¿ãéµäŸ¿çªå·ã§ã°ã«ãŒãåããåã䜿çšããŠçµæã®å€ãè¡šããŸãïŒFoliumã©ã€ãã©ãªã®Circleé¢æ°ïŒã
import folium
from folium import Circle
from folium import Marker
from folium.features import DivIcon
# map folium display
lat = data_location_lang_long.lat.mean()
long = data_location_lang_long.long.mean()
map1 = folium.Map(location = [lat, long], zoom_start = 12)
for i in range(0,len(data_location_lang_long)):
Circle(
location = [data_location_lang_long.iloc[i]['lat'], data_location_lang_long.iloc[i]['long']],
radius= [data_location_lang_long.iloc[i]['cost']/20000000],
fill = True, fill_color='#cc0000',color='#cc0000').add_to(map1)
Marker(
[data_location_mean.iloc[i]['lat'], data_location_mean.iloc[i]['long']],
icon=DivIcon(
icon_size=(6000,3336),
icon_anchor=(0,0),
html='<div style="font-size: 14pt; text-shadow: 0 0 10px #fff, 0 0 10px #fff;; color: #000";"">%s</div>'
%("$ "+ str((data_location_lang_long.iloc[i]['cost']/1000000000).round()) + ' mlrd.'))).add_to(map1)
map1
å°åºã§ã¯ããã€ã®å€§éšåãè«ççã«DownTownã«äžããããããšã¯æããã§ããåçŽã«ãã¹ãŠã®ãªããžã§ã¯ããåžå äžå¿éšãŸã§ã®è·é¢ãšåžå äžå¿éšã«å°éãããŸã§ã®æéïŒãã¡ãããé«äŸ¡ãªå®¶ã海岞ã«å»ºãŠãããŠããŸãïŒã§ã°ã«ãŒãåãããã¹ãŠã®ã¢ã¯ã»ã¹èš±å¯ã4ã€ã®ã°ã«ãŒãã«åããŸããïŒãããŠã³ã¿ãŠã³ããã<0.5HããŠã³ã¿ãŠã³ããã< 1HããŠã³ã¿ãŠã³ 'ã' SFå€ 'ã
from geopy.distance import vincenty
def distance_calc (row):
start = (row['lat'], row['long'])
stop = (37.7945742, -122.3999445)
return vincenty(start, stop).meters/1000
df_pr['distance'] = df_pr.apply (lambda row: distance_calc (row),axis=1)
def downtown_proximity(dist):
'''
< 2 -> Near Downtown, >= 2, <4 -> <0.5H Downtown
>= 4, <6 -> <1H Downtown, >= 8 -> Outside SF
'''
if dist < 2:
return 'Downtown'
elif dist < 4:
return '<0.5H Downtown'
elif dist < 6:
return '<1H Downtown'
elif dist >= 6:
return 'Outside SF'
df_pr['downtown_proximity'] = df_pr.distance.apply(downtown_proximity)
åžå ã«æè³ããã915åã®ãã¡ãä¿®çãšå»ºèšã«æè³ãããã»ãŒ700åïŒãã¹ãŠã®æè³ã®75ïŒ ïŒã¯ãåžå äžå¿éšïŒç·å°åž¯ïŒãšååŸ2 km以å ã®åžè¡å°ã«ãããŸããäžå€®ïŒãã«ãŒãŸãŒã³ïŒããã
éœåžå°åºããšã®å»ºèšç³è«ã®å¹³åæšå®ã³ã¹ã
ç·æè³ã®å Žåãšåæ§ã«ããã¹ãŠã®ããŒã¿ã¯éµäŸ¿çªå·å¥ã«ã°ã«ãŒãåãããŸããããã®å Žåã«ã®ã¿ãéµäŸ¿çªå·ã«ããã¢ããªã±ãŒã·ã§ã³ã®å¹³åïŒ.meanïŒïŒïŒæšå®ã³ã¹ãã䜿çšããŸãã
data_location_mean = data_location.groupby(['zipcode'])['lat','long','estimated_cost'].mean()
åžå ã®éåžžã®ãšãªã¢ïŒ2 km以äžãåžå äžå¿éšããïŒ-建èšç³è«ã®å¹³åæšå®ã³ã¹ãã¯5äžãã«ã§ãã
åžå äžå¿éšãšãªã¢ã®å¹³åæšå®ã³ã¹ãã¯ãçŽ3åïŒ15äžãã«ãã40äžãã«ïŒã§ãããã®ä»ã®å°åïŒ$ 30-50åïŒã
åå°ã®ã³ã¹ããšã¯å¥ã«ãäœå® 建èšã®ç·ã³ã¹ãã決å®ãã3ã€ã®èŠçŽ ïŒåŽåãææãããã³æ¿åºã®ææ°æãããã3ã€ã®èŠçŽ ã¯ãã«ãªãã©ã«ãã¢ã®ä»ã®å°åãããã«ãªãã©ã«ãã¢ã§é«ããªã£ãŠããŸããã«ãªãã©ã«ãã¢å·ã®å»ºç¯åºæºãšåºæºã¯ãïŒå°éãšç°å¢èŠå¶ã«ããïŒåœå ã§æãå æ¬çã§å³æ Œãªãã®ãšèŠãªãããŠãããå€ãã®å Žåãããé«äŸ¡ãªææãšåŽååãå¿ èŠãšããŸãã
ããšãã°ãæ¿åºã¯ãé«ããšãã«ã®ãŒå¹çåºæºãéæããããã«ã建èšæ¥è ã«é«å質ã®å»ºç¯ææïŒçªãæç±æãå·ææ¿ã·ã¹ãã ïŒã䜿çšããããã«èŠæ±ããŠããŸãã
èš±å¯ç³è«ã®å¹³åè²»çšã«é¢ããäžè¬çãªçµ±èšããã2ã€ã®å Žæãããã¯ã¢ãŠããããŠããŸãã
- ãã¬ãžã£ãŒã¢ã€ã©ã³ãã¯ããµã³ãã©ã³ã·ã¹ã³æ¹Ÿã®äººå·¥å³¶ã§ãã建ç¯èš±å¯ã®å¹³åæšå®ã³ã¹ãã¯650äžãã«ã§ãã
- ããã·ã§ã³ã〠-ïŒ2,926äœãïŒå»ºç¯èš±å¯ã®å¹³åæšå®ã³ã¹ã-150äžãã«ã
å®éããããã®2ã€ã®å°åºã§ã®å¹³åçãªã¢ããªã±ãŒã·ã§ã³ã®æ°ãå€ãã®ã¯ããããã®éµäŸ¿å Žæã§ã®ã¢ããªã±ãŒã·ã§ã³ã®æ°ãæãå°ãªãïŒãããã145ãš3064ã島ã§ã®å»ºèšã¯éåžžã«éãããŠããïŒäžæ¹ã§ãæ®ãã®éµäŸ¿çªå·ã«ã€ããŠã¯ã1980幎ãã2019幎ãŸã§ã®æéã§ãçŽ1300幎éã®ã¢ããªã±ãŒã·ã§ã³æ°ïŒå šäœã§ãæéå šäœã§å¹³å3äžãã5äžã®ã¢ããªã±ãŒã·ã§ã³ïŒã
ãã©ã¡ãŒã¿ãã¢ããªã±ãŒã·ã§ã³æ°ãã«ãããšã1ã€ã®éµäŸ¿çªå·ãããã®ã¢ããªã±ãŒã·ã§ã³æ°ã®çæ³çãªååžã¯ãéœåžå šäœã§é¡èã§ãã
æå¥ããã³æ¥å¥ã®ã¢ããªã±ãŒã·ã§ã³ç·æ°ã«é¢ããçµ±èš
1980幎ãã2019幎ãŸã§ã®æãšææ¥å¥ã®ã¢ããªã±ãŒã·ã§ã³ã®ç·æ°ã«é¢ããå šäœçãªçµ±èšã§ã¯ã建ç¯éšéã®ãæãéããªãæã¯æ¥ãšå¬ã§ããåæã«ãç³è«æžã«ç€ºãããŠããæè³é¡ã¯å€§ããç°ãªããæããšã«ç°ãªãå ŽåããããŸãïŒãå£ç¯ã«å¿ãã建èšæŽ»åããåç §ïŒãæææ¥ã®ææ¥ã®äžã§ãéšéã®ã¯ãŒã¯ããŒãã¯ãä»ã®ææ¥ãããçŽ20ïŒ å°ãªããªã£ãŠããŸãã
months = [ 'January', 'February', 'March', 'April', 'May','June', 'July', 'August', 'September', 'October', 'November', 'December' ]
data_month_count = data_month.groupby(['permit_creation_date']).count().reindex(months)
6æãš7æã®ç³è«ä»¶æ°ã¯ã»ãŒåãã§ãããæšå®ç·è²»çšã§ã¿ããšãå·®ã¯100ïŒ ïŒ5æãš7æã¯43åã6æã¯82åïŒã«éããŸãã
data_month_sum = data_month.groupby(['permit_creation_date']).sum().reindex(months)
ãµã³ãã©ã³ã·ã¹ã³ã®å»ºèšæ¥çã®å°æ¥ããã¿ãŒã³å¥ã«æŽ»åãäºæž¬ããŸãã
çµè«ãšããŠããµã³ãã©ã³ã·ã¹ã³ã®å»ºèšæŽ»åã®ã°ã©ãããããã³ã€ã³äŸ¡æ Œã®ã°ã©ãïŒ2015-2018ïŒãšéäŸ¡æ Œã®ã°ã©ãïŒ1940-1980ïŒãšæ¯èŒããŸãããã¯ãã«ã«åæã§ã®
ãã¿ãŒã³ïŒè±èªã®ãã¿ãŒã³-ã¢ãã«ããµã³ãã«ããïŒãåŒã³åºãããŸãäŸ¡æ Œãæ°éããŸãã¯ææšã®æ°žç¶çãªç¹°ãè¿ãã®çµã¿åããããã¿ãŒã³åæã¯ããã¯ãã«ã«åæã®å ¬çã®1ã€ã«åºã¥ããŠããŸãããå±¥æŽã¯ããèªäœãç¹°ãè¿ãã-ããŒã¿ã®ç¹°ãè¿ãã®çµã¿åãããåæ§ã®çµæã«ã€ãªãããšèããããŠããŸãã
幎éã®æŽ»åã°ã©ãã§æšæž¬ã§ããäž»ãªãã¿ãŒã³ã¯ããã¬ã³ãã®å転ãã¿ãŒã³ã§ãããé ãšè©ãã§ããã°ã©ãã人éã®é ïŒããŒã¯ïŒãšäž¡åŽã®è©ïŒå°ããªããŒã¯ïŒã®ããã«èŠããããããã®ååãä»ããããŠããŸããäŸ¡æ Œãè°·ãçµã¶ç·ãäžåããšããã¿ãŒã³ã¯å®å šã§ãããšèŠãªãããåãã¯äžåãã«ãªãå¯èœæ§ããããŸãã
ãµã³ãã©ã³ã·ã¹ã³ã®å»ºèšæ¥çã«ããã掻åã®åãã¯ãéãšãããã³ã€ã³ã®äŸ¡æ Œã®äžæã®ã°ã©ããšã»ãŒå®å šã«äžèŽããŠããŸããããã3ã€ã®äŸ¡æ Œå€åãšæŽ»åã®ãã£ãŒãã®éå»ã®ããã©ãŒãã³ã¹ã¯ãé¡èãªé¡äŒŒç¹ã瀺ããŠããŸãã
å°æ¥ã®å»ºèšåžå Žã®åããäºæž¬ã§ããããã«ããã«ã¯ãããã2ã€ã®ãã¬ã³ããããããšã®çžé¢ä¿æ°ãèšç®ããå¿ èŠããããŸãã
2ã€ã®ç¢ºçå€æ°ã¯ããããã®çžé¢ã¢ãŒã¡ã³ãïŒãŸãã¯çžé¢ä¿æ°ïŒããŒããšç°ãªãå Žåã«çžé¢ãšåŒã°ããŸããçžé¢ã¢ãŒã¡ã³ãããŒãã®å Žåã¯ãéçžé¢éãšåŒã°ããŸãã
åŸãããå€ã1ã§ã¯ãªã0ã«è¿ãå Žåãæ確ãªãã¿ãŒã³ã«ã€ããŠè©±ãããšã¯æå³ããããŸãããããã¯é£ããæ°åŠã®åé¡ã§ããããã®ãããã¯ã«èå³ãæã€ãããããªãäžçŽã®åå¿ãã¡ãåŒãåãããããããªãã
ããïŒéç§åŠçã§ãïŒãµã³ãã©ã³ã·ã¹ã³ã®å»ºèšæ¥çã®ãããªãçºå±ã®ãããã¯ãèŠãŠãã ããïŒãã¿ãŒã³ããããã³ã€ã³ã®äŸ¡æ Œãšããã«äžèŽããå Žåããã®æ²èŠ³çãªéžæè¢ã«ããã°ããµã³ãã©ã³ã·ã¹ã³ã®å»ºèšæ¥çã®å±æ©ããæãåºãããšã¯ãå±æ©åŸã®æéã«å®¹æã§ã¯ãããŸããã
ããã楜芳çããªéçºãªãã·ã§ã³ã䜿çšãããšãããã§ã®æŽ»åããéäŸ¡æ Œãã·ããªãªã«åŸã£ãŠããå Žåã建èšæ¥çã®ææ°é¢æ°çæé·ã®ç¹°ãè¿ããå¯èœã«ãªããŸãããã®ã·ããªãªã§ã¯ã20ã30幎åŸïŒãããã10幎åŸïŒã«ã建èšã»ã¯ã¿ãŒã¯éçšãšéçºã®æ°ããªæ¥å¢ãäºæ³ããŸãã
次ã®ããŒãã§ã¯ãåã ã®å»ºèšç£æ¥ïŒå±æ ¹ããããã³ã®ä¿®çãé段ã®å»ºèšããã¹ã«ãŒã ãç£æ¥ããã®ä»ã®ããŒã¿ã«ã€ããŠã®ææ¡ãããå Žåã¯ã³ã¡ã³ãã«èšå ¥ããŠãã ããïŒã詳ãã調ã¹ãç¹å®ã®çš®é¡ã®äœæ¥ã®ã€ã³ãã¬ãšäœå® ããŒã³ã®åºå®éå©ãæ¯èŒããŸããšç±³åœåœåµã®å©åãïŒåºå®äœå® ããŒã³éå©ãšç±³åœåµå©åãïŒã
Jupyter NotebookïŒSan Franciscoãžã®ãªã³ã¯ã建ç¯éšé1980-2019ã
Kaggleããæã¡ã®æ¹-ãã©ã¹ããŒãïŒããããšãããããŸãïŒïŒ
ïŒã³ãŒãã®ã³ã¡ã³ããšèª¬æã¯åŸã§ããŒãããã¯ã«è¿œå ãããŸãïŒ
è±èªçãžã®ãªã³ã¯ïŒãµã³ãã©ã³ã·ã¹ã³å»ºèšæ¥çã®æµ®ãæ²ã¿ã建èšã®åŸåãšæŽå²ã
ç§ã®ã³ã³ãã³ããæ°ã«å ¥ã£ãããç§ã«ã³ãŒããŒãè²·ãããšãæ€èšããŠãã ããã
ãååããããšãããããŸããïŒ
èè ã®ããã«ã³ãŒããŒãè²·ã