-
Notifications
You must be signed in to change notification settings - Fork 16
/
5_Lecture Slides - Intro to Analytical Thinking & Plotting - updated.pptx
201 lines (201 loc) · 6.83 KB
/
5_Lecture Slides - Intro to Analytical Thinking & Plotting - updated.pptx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "W83QPTOvD8-1"
},
"source": [
"# Project - Intro to Analytical Thinking\n",
"\n",
"--- \n",
"## The description:\n",
"We will go back to the Berlin rental prices dataset. \n",
"\n",
"Apply the methodology you learned in the last lecture and today to answer the following questions. On top of writing the code, please specifiy your analytical approach.\n",
"\n",
"Suppose you are an analytics consultant and your client is the Senate of Berlin, looking to draft policy suggestions to **help make rent more affordable in the city.** While they have not (yet) asked you for a recommendation, they need to **understand the market's current state.**\n",
"\n",
"For that, you are asked:\n",
"\n",
"1. Is there a shortage of *affordable* apartments in Berlin in general, or is the issue concentrated in select neighbourhoods? (**hint**: you need to define the term \"affordable\" based on your own criteria first, before analyzing the number of apartments)\n",
"\n",
"2. `Additional question`: A few companies are exploring *apartment renovation* as a viable business model — what impact could this practice have on the availability of *affordable* apartments?\n",
"\n",
"\n",
"--- \n",
"## The dataset:\n",
"You all know this one already but to recap, this is a list of rental apartments in Berlin. One row is for one appartment. The dataset contains 6 columns. \n",
"- Region: is the Berlin district, where the flat is located\n",
"- Condition: is the condition of the flat\n",
"- Rooms: The number of rooms the flat has\n",
"- Rent: Monthly rent for the flat\n",
"- Year_Construction: The year in which the house was build\n",
"- Space: The size of the flat in square meters\n",
"\n",
"As you dive into this analysis, please remember that this is a scraped **snapshot** of the marketplace (there's no time dimension in this dataset).\n",
"\n",
"--- \n",
"## The Task:\n",
"\n",
"For each of the two questions:\n",
"1. Define the term in the question that seem ambiguous\n",
"2. Break down the question into smaller questions that can be answered with an analysis as we have studied (**hint** see lecture slides: What plot fits to what analysis?)\n",
"3. Build a few plots or other types of analyses to answer the questions\n",
"4. Write a conclusion (addressing the Senate of Berlin) explaining the answer to the question"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 206
},
"id": "uPrb3Qy-BSiF",
"outputId": "b1a59ec5-c161-419e-ce6d-bae847687efb"
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Region</th>\n",
" <th>Condition</th>\n",
" <th>Rooms</th>\n",
" <th>Rent</th>\n",
" <th>Year_Construction</th>\n",
" <th>Space</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Mitte</td>\n",
" <td>first_time_use</td>\n",
" <td>4.0</td>\n",
" <td>2659.00</td>\n",
" <td>2019</td>\n",
" <td>117.20</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Kreuzberg</td>\n",
" <td>first_time_use</td>\n",
" <td>1.0</td>\n",
" <td>1200.00</td>\n",
" <td>2020</td>\n",
" <td>29.33</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Köpenick</td>\n",
" <td>well_kept</td>\n",
" <td>2.0</td>\n",
" <td>979.00</td>\n",
" <td>1997</td>\n",
" <td>83.61</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>Wilmersdorf</td>\n",
" <td>well_kept</td>\n",
" <td>4.0</td>\n",
" <td>1830.22</td>\n",
" <td>1900</td>\n",
" <td>171.18</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Kreuzberg</td>\n",
" <td>first_time_use</td>\n",
" <td>2.0</td>\n",
" <td>2272.00</td>\n",
" <td>2020</td>\n",
" <td>88.27</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Region Condition Rooms Rent Year_Construction Space\n",
"0 Mitte first_time_use 4.0 2659.00 2019 117.20\n",
"1 Kreuzberg first_time_use 1.0 1200.00 2020 29.33\n",
"2 Köpenick well_kept 2.0 979.00 1997 83.61\n",
"3 Wilmersdorf well_kept 4.0 1830.22 1900 171.18\n",
"4 Kreuzberg first_time_use 2.0 2272.00 2020 88.27"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Imports\n",
"import pandas as pd\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"import seaborn as sns\n",
"\n",
"# Get the dataset\n",
"df = pd.read_csv('https://raw.githubusercontent.com/juliandnl/redi_ss20/master/berlin_rental.csv')\n",
"df.head()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "8wgwgA610WAN"
},
"outputs": [],
"source": [
"# your code here"
]
}
],
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.9"
}
},
"nbformat": 4,
"nbformat_minor": 1
}