· 6 years ago · Oct 10, 2019, 11:40 PM
1{
2 "cells": [
3 {
4 "cell_type": "markdown",
5 "metadata": {},
6 "source": [
7 "The Battle of Neighborhoods (Week 1)"
8 ]
9 },
10 {
11 "cell_type": "code",
12 "execution_count": 1,
13 "metadata": {},
14 "outputs": [
15 {
16 "name": "stdout",
17 "output_type": "stream",
18 "text": [
19 "Solving environment: done\n",
20 "\n",
21 "\n",
22 "==> WARNING: A newer version of conda exists. <==\n",
23 " current version: 4.5.11\n",
24 " latest version: 4.7.12\n",
25 "\n",
26 "Please update conda by running\n",
27 "\n",
28 " $ conda update -n base -c defaults conda\n",
29 "\n",
30 "\n",
31 "\n",
32 "# All requested packages already installed.\n",
33 "\n",
34 "Libraries imported.\n"
35 ]
36 }
37 ],
38 "source": [
39 "import numpy as np # library to handle data in a vectorized manner\n",
40 "import time\n",
41 "import pandas as pd # library for data analsysis\n",
42 "pd.set_option('display.max_columns', None)\n",
43 "pd.set_option('display.max_rows', None)\n",
44 "\n",
45 "import json # library to handle JSON files\n",
46 "import requests # library to handle requests\n",
47 "from pandas.io.json import json_normalize # tranform JSON file into a pandas dataframe\n",
48 "\n",
49 "from geopy.geocoders import Nominatim # convert an address into latitude and longitude values\n",
50 "!conda install -c conda-forge folium=0.5.0 --yes # uncomment this line if you haven't completed the Foursquare API lab\n",
51 "import folium # map rendering library\n",
52 "\n",
53 "print('Libraries imported.')"
54 ]
55 },
56 {
57 "cell_type": "code",
58 "execution_count": 3,
59 "metadata": {},
60 "outputs": [
61 {
62 "name": "stdout",
63 "output_type": "stream",
64 "text": [
65 "Solving environment: done\n",
66 "\n",
67 "## Package Plan ##\n",
68 "\n",
69 " environment location: /home/jupyterlab/conda\n",
70 "\n",
71 " added / updated specs: \n",
72 " - conda\n",
73 "\n",
74 "\n",
75 "The following packages will be downloaded:\n",
76 "\n",
77 " package | build\n",
78 " ---------------------------|-----------------\n",
79 " certifi-2019.6.16 | py37_1 156 KB\n",
80 " ca-certificates-2019.5.15 | 1 134 KB\n",
81 " chardet-3.0.4 | py37_1003 173 KB\n",
82 " python-3.7.4 | h265db76_1 36.5 MB\n",
83 " pysocks-1.7.0 | py37_0 29 KB\n",
84 " pip-19.2.2 | py37_0 1.9 MB\n",
85 " ncurses-6.1 | he6710b0_1 958 KB\n",
86 " conda-4.7.12 | py37_0 3.0 MB\n",
87 " pycparser-2.19 | py37_0 172 KB\n",
88 " pyopenssl-19.0.0 | py37_0 82 KB\n",
89 " conda-package-handling-1.6.0| py37h7b6447c_0 872 KB\n",
90 " idna-2.8 | py37_0 101 KB\n",
91 " zlib-1.2.11 | h7b6447c_3 120 KB\n",
92 " libedit-3.1.20181209 | hc058e9b_0 188 KB\n",
93 " sqlite-3.29.0 | h7b6447c_0 1.9 MB\n",
94 " cryptography-2.7 | py37h1ba5d50_0 608 KB\n",
95 " urllib3-1.24.2 | py37_0 153 KB\n",
96 " setuptools-41.0.1 | py37_0 648 KB\n",
97 " six-1.12.0 | py37_0 22 KB\n",
98 " wheel-0.33.4 | py37_0 39 KB\n",
99 " cffi-1.12.3 | py37h2e261b9_0 222 KB\n",
100 " tqdm-4.32.1 | py_0 48 KB\n",
101 " openssl-1.1.1d | h7b6447c_1 3.7 MB\n",
102 " requests-2.22.0 | py37_0 89 KB\n",
103 " ------------------------------------------------------------\n",
104 " Total: 51.7 MB\n",
105 "\n",
106 "The following NEW packages will be INSTALLED:\n",
107 "\n",
108 " _libgcc_mutex: 0.1-main \n",
109 " conda-package-handling: 1.6.0-py37h7b6447c_0 \n",
110 "\n",
111 "The following packages will be UPDATED:\n",
112 "\n",
113 " ca-certificates: 2018.03.07-0 --> 2019.5.15-1 \n",
114 " certifi: 2018.8.24-py37_1 --> 2019.6.16-py37_1 \n",
115 " cffi: 1.11.5-py37he75722e_1 --> 1.12.3-py37h2e261b9_0 \n",
116 " chardet: 3.0.4-py37_1 --> 3.0.4-py37_1003 \n",
117 " conda: 4.5.11-py37_0 --> 4.7.12-py37_0 \n",
118 " cryptography: 2.3.1-py37hc365091_0 --> 2.7-py37h1ba5d50_0 \n",
119 " idna: 2.7-py37_0 --> 2.8-py37_0 \n",
120 " libedit: 3.1.20170329-h6b74fdf_2 --> 3.1.20181209-hc058e9b_0\n",
121 " libgcc-ng: 8.2.0-hdf63c60_1 --> 9.1.0-hdf63c60_0 \n",
122 " ncurses: 6.1-hf484d3e_0 --> 6.1-he6710b0_1 \n",
123 " openssl: 1.0.2p-h14c3975_0 --> 1.1.1d-h7b6447c_1 \n",
124 " pip: 10.0.1-py37_0 --> 19.2.2-py37_0 \n",
125 " pycparser: 2.18-py37_1 --> 2.19-py37_0 \n",
126 " pyopenssl: 18.0.0-py37_0 --> 19.0.0-py37_0 \n",
127 " pysocks: 1.6.8-py37_0 --> 1.7.0-py37_0 \n",
128 " python: 3.7.0-hc3d631a_0 --> 3.7.4-h265db76_1 \n",
129 " requests: 2.19.1-py37_0 --> 2.22.0-py37_0 \n",
130 " setuptools: 40.2.0-py37_0 --> 41.0.1-py37_0 \n",
131 " six: 1.11.0-py37_1 --> 1.12.0-py37_0 \n",
132 " sqlite: 3.24.0-h84994c4_0 --> 3.29.0-h7b6447c_0 \n",
133 " tqdm: 4.26.0-py37h28b3542_0 --> 4.32.1-py_0 \n",
134 " urllib3: 1.23-py37_0 --> 1.24.2-py37_0 \n",
135 " wheel: 0.31.1-py37_0 --> 0.33.4-py37_0 \n",
136 " zlib: 1.2.11-ha838bed_2 --> 1.2.11-h7b6447c_3 \n",
137 "\n",
138 "\n",
139 "Downloading and Extracting Packages\n",
140 "certifi-2019.6.16 | 156 KB | ##################################### | 100% \n",
141 "ca-certificates-2019 | 134 KB | ##################################### | 100% \n",
142 "chardet-3.0.4 | 173 KB | ##################################### | 100% \n",
143 "python-3.7.4 | 36.5 MB | ##################################### | 100% \n",
144 "pysocks-1.7.0 | 29 KB | ##################################### | 100% \n",
145 "pip-19.2.2 | 1.9 MB | ##################################### | 100% \n",
146 "ncurses-6.1 | 958 KB | ##################################### | 100% \n",
147 "conda-4.7.12 | 3.0 MB | ##################################### | 100% \n",
148 "pycparser-2.19 | 172 KB | ##################################### | 100% \n",
149 "pyopenssl-19.0.0 | 82 KB | ##################################### | 100% \n",
150 "conda-package-handli | 872 KB | ##################################### | 100% \n",
151 "idna-2.8 | 101 KB | ##################################### | 100% \n",
152 "zlib-1.2.11 | 120 KB | ##################################### | 100% \n",
153 "libedit-3.1.20181209 | 188 KB | ##################################### | 100% \n",
154 "sqlite-3.29.0 | 1.9 MB | ##################################### | 100% \n",
155 "cryptography-2.7 | 608 KB | ##################################### | 100% \n",
156 "urllib3-1.24.2 | 153 KB | ##################################### | 100% \n",
157 "setuptools-41.0.1 | 648 KB | ##################################### | 100% \n",
158 "six-1.12.0 | 22 KB | ##################################### | 100% \n",
159 "wheel-0.33.4 | 39 KB | ##################################### | 100% \n",
160 "cffi-1.12.3 | 222 KB | ##################################### | 100% \n",
161 "tqdm-4.32.1 | 48 KB | ##################################### | 100% \n",
162 "openssl-1.1.1d | 3.7 MB | ##################################### | 100% \n",
163 "requests-2.22.0 | 89 KB | ##################################### | 100% \n",
164 "Preparing transaction: done\n",
165 "Verifying transaction: done\n",
166 "Executing transaction: done\n",
167 "\n",
168 "Note: you may need to restart the kernel to use updated packages.\n"
169 ]
170 }
171 ],
172 "source": [
173 "conda update -n base -c defaults conda"
174 ]
175 },
176 {
177 "cell_type": "markdown",
178 "metadata": {},
179 "source": [
180 "# A description of the problem and a discussion of the background. (15 marks)"
181 ]
182 },
183 {
184 "cell_type": "markdown",
185 "metadata": {},
186 "source": [
187 "Discussion of the business problem and the audience who would be interested in this project"
188 ]
189 },
190 {
191 "cell_type": "markdown",
192 "metadata": {},
193 "source": [
194 "Description of the Problem and Background"
195 ]
196 },
197 {
198 "cell_type": "markdown",
199 "metadata": {},
200 "source": [
201 "Scenario:"
202 ]
203 },
204 {
205 "cell_type": "markdown",
206 "metadata": {},
207 "source": [
208 "I am a data scientist residing in Downtown Singapore. I currently live within walking distance to Downtown Telok Ayer MRT metro station and I enjoy many ammenities and venues in the area, such as various international cousine restaurants, cafes, food shops and entertainment. I have been offered a great opportunity to work for a leader firm in Manhattan, NY. I am very excited and I want to use this opportunity to practice my learnings in Coursera in order to answer relevant questions arisen. The key question is : How can I find a convenient and enjoyable place similar to mine now in Singapore? Certainly, I can use available real estate apps and Google but the idea is to use and apply myself the learned tools during the course. In order to make a comparison and evaluation of the rental options in Manhattan NY, I must set some basis, therefore the apartment in Manhattan must meet the following demands:\n",
209 "\n",
210 "1. apartment must be 2 or 3 bedrooms\n",
211 "2. desired location is near a metro station in the Manhatten area and within 1.0 mile (1.6 km) radius\n",
212 "3. price of rent not exceed 30,000 per month\n",
213 "4. top ammenities in the selected neighborhood shall be similar to current residence\n",
214 "5. desirable to have venues such as coffee shops, restaurants Asian Thai, wine stores, gym and food shops\n"
215 ]
216 },
217 {
218 "cell_type": "markdown",
219 "metadata": {},
220 "source": [
221 "Business Problem:"
222 ]
223 },
224 {
225 "cell_type": "markdown",
226 "metadata": {},
227 "source": [
228 "The challenge is to find a suitable apartment for rent in Manhatten that complies with the demands on location, price and venues. \n",
229 "The data required to resolve this challenge is described in the following section 2, below."
230 ]
231 },
232 {
233 "cell_type": "markdown",
234 "metadata": {},
235 "source": [
236 "Interested Audience :"
237 ]
238 },
239 {
240 "cell_type": "markdown",
241 "metadata": {},
242 "source": [
243 "I believe this is a relevant challenge with valid questions for anyone moving to other large city in US or Asia\n",
244 "The same methodology can be applied in accordance to demands as applicable. \n",
245 "This case is also applicable for anyone interested in exploring starting or locating a new business in any city. \n",
246 "Lastly, it can also serve as a good practical exercise to develop Data Science skills."
247 ]
248 }
249 ],
250 "metadata": {
251 "kernelspec": {
252 "display_name": "Python",
253 "language": "python",
254 "name": "conda-env-python-py"
255 },
256 "language_info": {
257 "codemirror_mode": {
258 "name": "ipython",
259 "version": 3
260 },
261 "file_extension": ".py",
262 "mimetype": "text/x-python",
263 "name": "python",
264 "nbconvert_exporter": "python",
265 "pygments_lexer": "ipython3",
266 "version": "3.6.7"
267 }
268 },
269 "nbformat": 4,
270 "nbformat_minor": 4
271}