Delete tools/flights/test.ipynb
Browse files- tools/flights/test.ipynb +0 -1063
tools/flights/test.ipynb
DELETED
@@ -1,1063 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"cells": [
|
3 |
-
{
|
4 |
-
"cell_type": "code",
|
5 |
-
"execution_count": 4,
|
6 |
-
"id": "041c9721",
|
7 |
-
"metadata": {},
|
8 |
-
"outputs": [],
|
9 |
-
"source": [
|
10 |
-
"import pandas as pd\n",
|
11 |
-
"data = pd.read_csv('/home/xj/toolAugEnv/code/toolConstraint/database/flights/Combined_Flights_2022.csv')\n",
|
12 |
-
"# df.to_csv('/home/xj/toolAugEnv/code/toolConstraint/database/flights/clean_Flights_2022.csv')"
|
13 |
-
]
|
14 |
-
},
|
15 |
-
{
|
16 |
-
"cell_type": "code",
|
17 |
-
"execution_count": 2,
|
18 |
-
"id": "03d0f39e",
|
19 |
-
"metadata": {},
|
20 |
-
"outputs": [
|
21 |
-
{
|
22 |
-
"data": {
|
23 |
-
"text/plain": [
|
24 |
-
"FlightDate 2022-03-15\n",
|
25 |
-
"Airline Delta Air Lines Inc.\n",
|
26 |
-
"Origin LAS\n",
|
27 |
-
"Dest SLC\n",
|
28 |
-
"Cancelled False\n",
|
29 |
-
" ... \n",
|
30 |
-
"ArrDel15 0.0\n",
|
31 |
-
"ArrivalDelayGroups -2.0\n",
|
32 |
-
"ArrTimeBlk 1600-1659\n",
|
33 |
-
"DistanceGroup 2\n",
|
34 |
-
"DivAirportLandings 0\n",
|
35 |
-
"Name: 3504987, Length: 61, dtype: object"
|
36 |
-
]
|
37 |
-
},
|
38 |
-
"execution_count": 2,
|
39 |
-
"metadata": {},
|
40 |
-
"output_type": "execute_result"
|
41 |
-
}
|
42 |
-
],
|
43 |
-
"source": [
|
44 |
-
"data.iloc[3504987]"
|
45 |
-
]
|
46 |
-
},
|
47 |
-
{
|
48 |
-
"cell_type": "code",
|
49 |
-
"execution_count": 5,
|
50 |
-
"id": "036418f5",
|
51 |
-
"metadata": {},
|
52 |
-
"outputs": [],
|
53 |
-
"source": [
|
54 |
-
"data_dict = data.to_dict(orient = 'split')"
|
55 |
-
]
|
56 |
-
},
|
57 |
-
{
|
58 |
-
"cell_type": "code",
|
59 |
-
"execution_count": 13,
|
60 |
-
"id": "ef12c4b3",
|
61 |
-
"metadata": {},
|
62 |
-
"outputs": [
|
63 |
-
{
|
64 |
-
"name": "stdout",
|
65 |
-
"output_type": "stream",
|
66 |
-
"text": [
|
67 |
-
"FlightDate 2022-01-29\n",
|
68 |
-
"Airline Frontier Airlines Inc.\n",
|
69 |
-
"Origin COS\n",
|
70 |
-
"Dest LAS\n",
|
71 |
-
"Cancelled False\n",
|
72 |
-
"Diverted False\n",
|
73 |
-
"CRSDepTime 1558\n",
|
74 |
-
"DepTime 1553.0\n",
|
75 |
-
"DepDelayMinutes 0.0\n",
|
76 |
-
"DepDelay -5.0\n",
|
77 |
-
"ArrTime 1646.0\n",
|
78 |
-
"ArrDelayMinutes 0.0\n",
|
79 |
-
"AirTime 91.0\n",
|
80 |
-
"CRSElapsedTime 124.0\n",
|
81 |
-
"ActualElapsedTime 113.0\n",
|
82 |
-
"Distance 604.0\n",
|
83 |
-
"Year 2022\n",
|
84 |
-
"Quarter 1\n",
|
85 |
-
"Month 1\n",
|
86 |
-
"DayofMonth 29\n",
|
87 |
-
"DayOfWeek 6\n",
|
88 |
-
"Marketing_Airline_Network F9\n",
|
89 |
-
"Operated_or_Branded_Code_Share_Partners F9\n",
|
90 |
-
"DOT_ID_Marketing_Airline 20436\n",
|
91 |
-
"IATA_Code_Marketing_Airline F9\n",
|
92 |
-
"Flight_Number_Marketing_Airline 2019\n",
|
93 |
-
"Operating_Airline F9\n",
|
94 |
-
"DOT_ID_Operating_Airline 20436\n",
|
95 |
-
"IATA_Code_Operating_Airline F9\n",
|
96 |
-
"Tail_Number N235FR\n",
|
97 |
-
"Flight_Number_Operating_Airline 2019\n",
|
98 |
-
"OriginAirportID 11109\n",
|
99 |
-
"OriginAirportSeqID 1110902\n",
|
100 |
-
"OriginCityMarketID 30189\n",
|
101 |
-
"OriginCityName Colorado Springs, CO\n",
|
102 |
-
"OriginState CO\n",
|
103 |
-
"OriginStateFips 8\n",
|
104 |
-
"OriginStateName Colorado\n",
|
105 |
-
"OriginWac 82\n",
|
106 |
-
"DestAirportID 12889\n",
|
107 |
-
"DestAirportSeqID 1288903\n",
|
108 |
-
"DestCityMarketID 32211\n",
|
109 |
-
"DestCityName Las Vegas, NV\n",
|
110 |
-
"DestState NV\n",
|
111 |
-
"DestStateFips 32\n",
|
112 |
-
"DestStateName Nevada\n",
|
113 |
-
"DestWac 85\n",
|
114 |
-
"DepDel15 0.0\n",
|
115 |
-
"DepartureDelayGroups -1.0\n",
|
116 |
-
"DepTimeBlk 1500-1559\n",
|
117 |
-
"TaxiOut 13.0\n",
|
118 |
-
"WheelsOff 1606.0\n",
|
119 |
-
"WheelsOn 1637.0\n",
|
120 |
-
"TaxiIn 9.0\n",
|
121 |
-
"CRSArrTime 1702\n",
|
122 |
-
"ArrDelay -16.0\n",
|
123 |
-
"ArrDel15 0.0\n",
|
124 |
-
"ArrivalDelayGroups -2.0\n",
|
125 |
-
"ArrTimeBlk 1700-1759\n",
|
126 |
-
"DistanceGroup 3\n",
|
127 |
-
"DivAirportLandings 0\n"
|
128 |
-
]
|
129 |
-
}
|
130 |
-
],
|
131 |
-
"source": [
|
132 |
-
"for idx,unit in enumerate(data_dict['columns']):\n",
|
133 |
-
" print(unit, data_dict['data'][3000020][idx])"
|
134 |
-
]
|
135 |
-
},
|
136 |
-
{
|
137 |
-
"cell_type": "code",
|
138 |
-
"execution_count": 12,
|
139 |
-
"id": "372b3fd9",
|
140 |
-
"metadata": {},
|
141 |
-
"outputs": [
|
142 |
-
{
|
143 |
-
"data": {
|
144 |
-
"text/plain": [
|
145 |
-
"['2022-01-29',\n",
|
146 |
-
" 'Frontier Airlines Inc.',\n",
|
147 |
-
" 'COS',\n",
|
148 |
-
" 'LAS',\n",
|
149 |
-
" False,\n",
|
150 |
-
" False,\n",
|
151 |
-
" 1558,\n",
|
152 |
-
" 1553.0,\n",
|
153 |
-
" 0.0,\n",
|
154 |
-
" -5.0,\n",
|
155 |
-
" 1646.0,\n",
|
156 |
-
" 0.0,\n",
|
157 |
-
" 91.0,\n",
|
158 |
-
" 124.0,\n",
|
159 |
-
" 113.0,\n",
|
160 |
-
" 604.0,\n",
|
161 |
-
" 2022,\n",
|
162 |
-
" 1,\n",
|
163 |
-
" 1,\n",
|
164 |
-
" 29,\n",
|
165 |
-
" 6,\n",
|
166 |
-
" 'F9',\n",
|
167 |
-
" 'F9',\n",
|
168 |
-
" 20436,\n",
|
169 |
-
" 'F9',\n",
|
170 |
-
" 2019,\n",
|
171 |
-
" 'F9',\n",
|
172 |
-
" 20436,\n",
|
173 |
-
" 'F9',\n",
|
174 |
-
" 'N235FR',\n",
|
175 |
-
" 2019,\n",
|
176 |
-
" 11109,\n",
|
177 |
-
" 1110902,\n",
|
178 |
-
" 30189,\n",
|
179 |
-
" 'Colorado Springs, CO',\n",
|
180 |
-
" 'CO',\n",
|
181 |
-
" 8,\n",
|
182 |
-
" 'Colorado',\n",
|
183 |
-
" 82,\n",
|
184 |
-
" 12889,\n",
|
185 |
-
" 1288903,\n",
|
186 |
-
" 32211,\n",
|
187 |
-
" 'Las Vegas, NV',\n",
|
188 |
-
" 'NV',\n",
|
189 |
-
" 32,\n",
|
190 |
-
" 'Nevada',\n",
|
191 |
-
" 85,\n",
|
192 |
-
" 0.0,\n",
|
193 |
-
" -1.0,\n",
|
194 |
-
" '1500-1559',\n",
|
195 |
-
" 13.0,\n",
|
196 |
-
" 1606.0,\n",
|
197 |
-
" 1637.0,\n",
|
198 |
-
" 9.0,\n",
|
199 |
-
" 1702,\n",
|
200 |
-
" -16.0,\n",
|
201 |
-
" 0.0,\n",
|
202 |
-
" -2.0,\n",
|
203 |
-
" '1700-1759',\n",
|
204 |
-
" 3,\n",
|
205 |
-
" 0]"
|
206 |
-
]
|
207 |
-
},
|
208 |
-
"execution_count": 12,
|
209 |
-
"metadata": {},
|
210 |
-
"output_type": "execute_result"
|
211 |
-
}
|
212 |
-
],
|
213 |
-
"source": [
|
214 |
-
"data_dict['data'][3000020]"
|
215 |
-
]
|
216 |
-
},
|
217 |
-
{
|
218 |
-
"cell_type": "code",
|
219 |
-
"execution_count": 11,
|
220 |
-
"id": "371a85fd",
|
221 |
-
"metadata": {},
|
222 |
-
"outputs": [
|
223 |
-
{
|
224 |
-
"name": "stdout",
|
225 |
-
"output_type": "stream",
|
226 |
-
"text": [
|
227 |
-
"4078318\n"
|
228 |
-
]
|
229 |
-
}
|
230 |
-
],
|
231 |
-
"source": [
|
232 |
-
"print(len(data_dict['data']))"
|
233 |
-
]
|
234 |
-
},
|
235 |
-
{
|
236 |
-
"cell_type": "code",
|
237 |
-
"execution_count": 12,
|
238 |
-
"id": "64d46483",
|
239 |
-
"metadata": {},
|
240 |
-
"outputs": [
|
241 |
-
{
|
242 |
-
"name": "stdout",
|
243 |
-
"output_type": "stream",
|
244 |
-
"text": [
|
245 |
-
"FlightDate 0\n",
|
246 |
-
"DepTime 7\n",
|
247 |
-
"ArrTime 10\n",
|
248 |
-
"ActualElapsedTime 14\n",
|
249 |
-
"Distance 15\n",
|
250 |
-
"OriginCityName 34\n",
|
251 |
-
"DestCityName 42\n"
|
252 |
-
]
|
253 |
-
}
|
254 |
-
],
|
255 |
-
"source": [
|
256 |
-
"for idx,unit in enumerate(data_dict['columns']):\n",
|
257 |
-
" if unit in ['FlightDate','DepTime','ArrTime','ActualElapsedTime','Distance','OriginCityName','DestCityName']:\n",
|
258 |
-
" print(unit, str(idx))"
|
259 |
-
]
|
260 |
-
},
|
261 |
-
{
|
262 |
-
"cell_type": "code",
|
263 |
-
"execution_count": 6,
|
264 |
-
"id": "81047adf",
|
265 |
-
"metadata": {},
|
266 |
-
"outputs": [],
|
267 |
-
"source": [
|
268 |
-
"import math\n",
|
269 |
-
"def convert_to_hhmm(time_float):\n",
|
270 |
-
" \"\"\"\n",
|
271 |
-
" Convert a float time to hh:mm format\n",
|
272 |
-
" :param time_float: Time as a float. Example: 757.0\n",
|
273 |
-
" :return: Time in hh:mm format. Example: \"07:57\"\n",
|
274 |
-
" \"\"\"\n",
|
275 |
-
" try:\n",
|
276 |
-
" hours = int(time_float // 100)\n",
|
277 |
-
" minutes = int(time_float % 100)\n",
|
278 |
-
" return \"{:02d}:{:02d}\".format(hours, minutes)\n",
|
279 |
-
" except:\n",
|
280 |
-
" return time_float\n",
|
281 |
-
"\n",
|
282 |
-
"def minutes_to_hours_minutes(minutes):\n",
|
283 |
-
" # Check for NaN and handle it\n",
|
284 |
-
" if math.isnan(minutes):\n",
|
285 |
-
" return \"NaN\"\n",
|
286 |
-
" \n",
|
287 |
-
" # Ensure minutes is an integer or rounded to the nearest integer\n",
|
288 |
-
" minutes = round(minutes)\n",
|
289 |
-
" \n",
|
290 |
-
" hours = minutes // 60\n",
|
291 |
-
" remaining_minutes = minutes % 60\n",
|
292 |
-
" return f\"{hours} hours {remaining_minutes} minutes\""
|
293 |
-
]
|
294 |
-
},
|
295 |
-
{
|
296 |
-
"cell_type": "code",
|
297 |
-
"execution_count": 7,
|
298 |
-
"id": "ee34cbde",
|
299 |
-
"metadata": {},
|
300 |
-
"outputs": [
|
301 |
-
{
|
302 |
-
"data": {
|
303 |
-
"application/vnd.jupyter.widget-view+json": {
|
304 |
-
"model_id": "b60c3d13fb6d44258103c6251365272b",
|
305 |
-
"version_major": 2,
|
306 |
-
"version_minor": 0
|
307 |
-
},
|
308 |
-
"text/plain": [
|
309 |
-
"0it [00:00, ?it/s]"
|
310 |
-
]
|
311 |
-
},
|
312 |
-
"metadata": {},
|
313 |
-
"output_type": "display_data"
|
314 |
-
}
|
315 |
-
],
|
316 |
-
"source": [
|
317 |
-
"from tqdm.autonotebook import tqdm\n",
|
318 |
-
"import random\n",
|
319 |
-
"new_data = []\n",
|
320 |
-
"for idx, unit in tqdm(enumerate(data_dict['data'])):\n",
|
321 |
-
" tmp_dict = {k:\"\" for k in ['FlightDate','DepTime','ArrTime','ActualElapsedTime','Distance','OriginCityName','DestCityName','Price']}\n",
|
322 |
-
" tmp_dict['FlightDate'] = unit[0]\n",
|
323 |
-
" tmp_dict['DepTime'] = convert_to_hhmm(unit[7])\n",
|
324 |
-
" tmp_dict['ArrTime'] = convert_to_hhmm(unit[10])\n",
|
325 |
-
" tmp_dict['ActualElapsedTime'] = minutes_to_hours_minutes(unit[14])\n",
|
326 |
-
" tmp_dict['Distance'] = unit[15]\n",
|
327 |
-
" tmp_dict['OriginCityName'] = unit[34].split(',')[0].split('/')[0]\n",
|
328 |
-
" tmp_dict['DestCityName'] = unit[42].split(',')[0].split('/')[0]\n",
|
329 |
-
" tmp_dict['Price'] = int((unit[15]) * random.uniform(0.2,0.5))\n",
|
330 |
-
" new_data.append(tmp_dict)"
|
331 |
-
]
|
332 |
-
},
|
333 |
-
{
|
334 |
-
"cell_type": "code",
|
335 |
-
"execution_count": 11,
|
336 |
-
"id": "aee3f422",
|
337 |
-
"metadata": {},
|
338 |
-
"outputs": [
|
339 |
-
{
|
340 |
-
"data": {
|
341 |
-
"text/plain": [
|
342 |
-
"{'FlightDate': '2022-01-29',\n",
|
343 |
-
" 'DepTime': '15:53',\n",
|
344 |
-
" 'ArrTime': '16:46',\n",
|
345 |
-
" 'ActualElapsedTime': '1 hours 53 minutes',\n",
|
346 |
-
" 'Distance': 604.0,\n",
|
347 |
-
" 'OriginCityName': 'Colorado Springs',\n",
|
348 |
-
" 'DestCityName': 'Las Vegas',\n",
|
349 |
-
" 'Price': 205}"
|
350 |
-
]
|
351 |
-
},
|
352 |
-
"execution_count": 11,
|
353 |
-
"metadata": {},
|
354 |
-
"output_type": "execute_result"
|
355 |
-
}
|
356 |
-
],
|
357 |
-
"source": [
|
358 |
-
"new_data[3000020]"
|
359 |
-
]
|
360 |
-
},
|
361 |
-
{
|
362 |
-
"cell_type": "code",
|
363 |
-
"execution_count": 90,
|
364 |
-
"id": "bfb243c0",
|
365 |
-
"metadata": {},
|
366 |
-
"outputs": [],
|
367 |
-
"source": [
|
368 |
-
"df = pd.DataFrame(new_data)"
|
369 |
-
]
|
370 |
-
},
|
371 |
-
{
|
372 |
-
"cell_type": "code",
|
373 |
-
"execution_count": 62,
|
374 |
-
"id": "f152a150",
|
375 |
-
"metadata": {},
|
376 |
-
"outputs": [
|
377 |
-
{
|
378 |
-
"data": {
|
379 |
-
"text/html": [
|
380 |
-
"<div>\n",
|
381 |
-
"<style scoped>\n",
|
382 |
-
" .dataframe tbody tr th:only-of-type {\n",
|
383 |
-
" vertical-align: middle;\n",
|
384 |
-
" }\n",
|
385 |
-
"\n",
|
386 |
-
" .dataframe tbody tr th {\n",
|
387 |
-
" vertical-align: top;\n",
|
388 |
-
" }\n",
|
389 |
-
"\n",
|
390 |
-
" .dataframe thead th {\n",
|
391 |
-
" text-align: right;\n",
|
392 |
-
" }\n",
|
393 |
-
"</style>\n",
|
394 |
-
"<table border=\"1\" class=\"dataframe\">\n",
|
395 |
-
" <thead>\n",
|
396 |
-
" <tr style=\"text-align: right;\">\n",
|
397 |
-
" <th></th>\n",
|
398 |
-
" <th>FlightDate</th>\n",
|
399 |
-
" <th>DepTime</th>\n",
|
400 |
-
" <th>ArrTime</th>\n",
|
401 |
-
" <th>ActualElapsedTime</th>\n",
|
402 |
-
" <th>Distance</th>\n",
|
403 |
-
" <th>OriginCityName</th>\n",
|
404 |
-
" <th>DestCityName</th>\n",
|
405 |
-
" <th>Price</th>\n",
|
406 |
-
" </tr>\n",
|
407 |
-
" </thead>\n",
|
408 |
-
" <tbody>\n",
|
409 |
-
" <tr>\n",
|
410 |
-
" <th>3488394</th>\n",
|
411 |
-
" <td>2022-03-01</td>\n",
|
412 |
-
" <td>07:24</td>\n",
|
413 |
-
" <td>15:15</td>\n",
|
414 |
-
" <td>4 hours 51 minutes</td>\n",
|
415 |
-
" <td>2422.0</td>\n",
|
416 |
-
" <td>Seattle</td>\n",
|
417 |
-
" <td>New York</td>\n",
|
418 |
-
" <td>720</td>\n",
|
419 |
-
" </tr>\n",
|
420 |
-
" <tr>\n",
|
421 |
-
" <th>3509382</th>\n",
|
422 |
-
" <td>2022-03-01</td>\n",
|
423 |
-
" <td>22:29</td>\n",
|
424 |
-
" <td>06:07</td>\n",
|
425 |
-
" <td>4 hours 38 minutes</td>\n",
|
426 |
-
" <td>2422.0</td>\n",
|
427 |
-
" <td>Seattle</td>\n",
|
428 |
-
" <td>New York</td>\n",
|
429 |
-
" <td>484</td>\n",
|
430 |
-
" </tr>\n",
|
431 |
-
" <tr>\n",
|
432 |
-
" <th>3736056</th>\n",
|
433 |
-
" <td>2022-03-01</td>\n",
|
434 |
-
" <td>23:33</td>\n",
|
435 |
-
" <td>07:16</td>\n",
|
436 |
-
" <td>4 hours 43 minutes</td>\n",
|
437 |
-
" <td>2422.0</td>\n",
|
438 |
-
" <td>Seattle</td>\n",
|
439 |
-
" <td>New York</td>\n",
|
440 |
-
" <td>1199</td>\n",
|
441 |
-
" </tr>\n",
|
442 |
-
" <tr>\n",
|
443 |
-
" <th>3736260</th>\n",
|
444 |
-
" <td>2022-03-01</td>\n",
|
445 |
-
" <td>14:37</td>\n",
|
446 |
-
" <td>22:05</td>\n",
|
447 |
-
" <td>4 hours 28 minutes</td>\n",
|
448 |
-
" <td>2422.0</td>\n",
|
449 |
-
" <td>Seattle</td>\n",
|
450 |
-
" <td>New York</td>\n",
|
451 |
-
" <td>950</td>\n",
|
452 |
-
" </tr>\n",
|
453 |
-
" <tr>\n",
|
454 |
-
" <th>3736313</th>\n",
|
455 |
-
" <td>2022-03-01</td>\n",
|
456 |
-
" <td>09:11</td>\n",
|
457 |
-
" <td>17:17</td>\n",
|
458 |
-
" <td>5 hours 6 minutes</td>\n",
|
459 |
-
" <td>2422.0</td>\n",
|
460 |
-
" <td>Seattle</td>\n",
|
461 |
-
" <td>New York</td>\n",
|
462 |
-
" <td>1050</td>\n",
|
463 |
-
" </tr>\n",
|
464 |
-
" <tr>\n",
|
465 |
-
" <th>3776858</th>\n",
|
466 |
-
" <td>2022-03-01</td>\n",
|
467 |
-
" <td>21:01</td>\n",
|
468 |
-
" <td>04:32</td>\n",
|
469 |
-
" <td>4 hours 31 minutes</td>\n",
|
470 |
-
" <td>2422.0</td>\n",
|
471 |
-
" <td>Seattle</td>\n",
|
472 |
-
" <td>New York</td>\n",
|
473 |
-
" <td>1146</td>\n",
|
474 |
-
" </tr>\n",
|
475 |
-
" <tr>\n",
|
476 |
-
" <th>3778565</th>\n",
|
477 |
-
" <td>2022-03-01</td>\n",
|
478 |
-
" <td>13:18</td>\n",
|
479 |
-
" <td>21:08</td>\n",
|
480 |
-
" <td>4 hours 50 minutes</td>\n",
|
481 |
-
" <td>2422.0</td>\n",
|
482 |
-
" <td>Seattle</td>\n",
|
483 |
-
" <td>New York</td>\n",
|
484 |
-
" <td>578</td>\n",
|
485 |
-
" </tr>\n",
|
486 |
-
" </tbody>\n",
|
487 |
-
"</table>\n",
|
488 |
-
"</div>"
|
489 |
-
],
|
490 |
-
"text/plain": [
|
491 |
-
" FlightDate DepTime ArrTime ActualElapsedTime Distance \n",
|
492 |
-
"3488394 2022-03-01 07:24 15:15 4 hours 51 minutes 2422.0 \\\n",
|
493 |
-
"3509382 2022-03-01 22:29 06:07 4 hours 38 minutes 2422.0 \n",
|
494 |
-
"3736056 2022-03-01 23:33 07:16 4 hours 43 minutes 2422.0 \n",
|
495 |
-
"3736260 2022-03-01 14:37 22:05 4 hours 28 minutes 2422.0 \n",
|
496 |
-
"3736313 2022-03-01 09:11 17:17 5 hours 6 minutes 2422.0 \n",
|
497 |
-
"3776858 2022-03-01 21:01 04:32 4 hours 31 minutes 2422.0 \n",
|
498 |
-
"3778565 2022-03-01 13:18 21:08 4 hours 50 minutes 2422.0 \n",
|
499 |
-
"\n",
|
500 |
-
" OriginCityName DestCityName Price \n",
|
501 |
-
"3488394 Seattle New York 720 \n",
|
502 |
-
"3509382 Seattle New York 484 \n",
|
503 |
-
"3736056 Seattle New York 1199 \n",
|
504 |
-
"3736260 Seattle New York 950 \n",
|
505 |
-
"3736313 Seattle New York 1050 \n",
|
506 |
-
"3776858 Seattle New York 1146 \n",
|
507 |
-
"3778565 Seattle New York 578 "
|
508 |
-
]
|
509 |
-
},
|
510 |
-
"execution_count": 62,
|
511 |
-
"metadata": {},
|
512 |
-
"output_type": "execute_result"
|
513 |
-
}
|
514 |
-
],
|
515 |
-
"source": [
|
516 |
-
"df[(df['OriginCityName']=='Seattle') & (df['DestCityName']=='New York')& (df['FlightDate']=='2022-03-01')]"
|
517 |
-
]
|
518 |
-
},
|
519 |
-
{
|
520 |
-
"cell_type": "code",
|
521 |
-
"execution_count": 92,
|
522 |
-
"id": "9f85d8e6",
|
523 |
-
"metadata": {},
|
524 |
-
"outputs": [],
|
525 |
-
"source": [
|
526 |
-
"df['Flight Number'] = df.index"
|
527 |
-
]
|
528 |
-
},
|
529 |
-
{
|
530 |
-
"cell_type": "code",
|
531 |
-
"execution_count": 93,
|
532 |
-
"id": "045df94c",
|
533 |
-
"metadata": {},
|
534 |
-
"outputs": [],
|
535 |
-
"source": [
|
536 |
-
"df = df.reset_index(drop=True)"
|
537 |
-
]
|
538 |
-
},
|
539 |
-
{
|
540 |
-
"cell_type": "code",
|
541 |
-
"execution_count": null,
|
542 |
-
"id": "4e1b68b7",
|
543 |
-
"metadata": {},
|
544 |
-
"outputs": [],
|
545 |
-
"source": []
|
546 |
-
},
|
547 |
-
{
|
548 |
-
"cell_type": "code",
|
549 |
-
"execution_count": 91,
|
550 |
-
"id": "5c7d3b44",
|
551 |
-
"metadata": {},
|
552 |
-
"outputs": [],
|
553 |
-
"source": [
|
554 |
-
"df.index = df.index.map(lambda x: str(x).zfill(7))"
|
555 |
-
]
|
556 |
-
},
|
557 |
-
{
|
558 |
-
"cell_type": "code",
|
559 |
-
"execution_count": 94,
|
560 |
-
"id": "7a1f223c",
|
561 |
-
"metadata": {},
|
562 |
-
"outputs": [],
|
563 |
-
"source": [
|
564 |
-
"df['Flight Number'] = 'F' + df['Flight Number'].astype(str)"
|
565 |
-
]
|
566 |
-
},
|
567 |
-
{
|
568 |
-
"cell_type": "code",
|
569 |
-
"execution_count": 97,
|
570 |
-
"id": "af7e3411",
|
571 |
-
"metadata": {},
|
572 |
-
"outputs": [],
|
573 |
-
"source": [
|
574 |
-
"df.to_csv('/home/xj/toolAugEnv/code/toolConstraint/database/flights/clean_Flights_2022.csv')"
|
575 |
-
]
|
576 |
-
},
|
577 |
-
{
|
578 |
-
"cell_type": "code",
|
579 |
-
"execution_count": 95,
|
580 |
-
"id": "461e83ef",
|
581 |
-
"metadata": {},
|
582 |
-
"outputs": [],
|
583 |
-
"source": [
|
584 |
-
"x = df[df['OriginCityName']=='Montrose']"
|
585 |
-
]
|
586 |
-
},
|
587 |
-
{
|
588 |
-
"cell_type": "code",
|
589 |
-
"execution_count": 53,
|
590 |
-
"id": "ed4e2107",
|
591 |
-
"metadata": {},
|
592 |
-
"outputs": [],
|
593 |
-
"source": [
|
594 |
-
"x = df[df['DestCityName']=='Montrose']"
|
595 |
-
]
|
596 |
-
},
|
597 |
-
{
|
598 |
-
"cell_type": "code",
|
599 |
-
"execution_count": 96,
|
600 |
-
"id": "56c918e3",
|
601 |
-
"metadata": {},
|
602 |
-
"outputs": [
|
603 |
-
{
|
604 |
-
"data": {
|
605 |
-
"text/html": [
|
606 |
-
"<div>\n",
|
607 |
-
"<style scoped>\n",
|
608 |
-
" .dataframe tbody tr th:only-of-type {\n",
|
609 |
-
" vertical-align: middle;\n",
|
610 |
-
" }\n",
|
611 |
-
"\n",
|
612 |
-
" .dataframe tbody tr th {\n",
|
613 |
-
" vertical-align: top;\n",
|
614 |
-
" }\n",
|
615 |
-
"\n",
|
616 |
-
" .dataframe thead th {\n",
|
617 |
-
" text-align: right;\n",
|
618 |
-
" }\n",
|
619 |
-
"</style>\n",
|
620 |
-
"<table border=\"1\" class=\"dataframe\">\n",
|
621 |
-
" <thead>\n",
|
622 |
-
" <tr style=\"text-align: right;\">\n",
|
623 |
-
" <th></th>\n",
|
624 |
-
" <th>FlightDate</th>\n",
|
625 |
-
" <th>DepTime</th>\n",
|
626 |
-
" <th>ArrTime</th>\n",
|
627 |
-
" <th>ActualElapsedTime</th>\n",
|
628 |
-
" <th>Distance</th>\n",
|
629 |
-
" <th>OriginCityName</th>\n",
|
630 |
-
" <th>DestCityName</th>\n",
|
631 |
-
" <th>Price</th>\n",
|
632 |
-
" <th>Flight Number</th>\n",
|
633 |
-
" </tr>\n",
|
634 |
-
" </thead>\n",
|
635 |
-
" <tbody>\n",
|
636 |
-
" <tr>\n",
|
637 |
-
" <th>4155</th>\n",
|
638 |
-
" <td>2022-04-01</td>\n",
|
639 |
-
" <td>10:42</td>\n",
|
640 |
-
" <td>11:34</td>\n",
|
641 |
-
" <td>0 hours 52 minutes</td>\n",
|
642 |
-
" <td>196.0</td>\n",
|
643 |
-
" <td>Montrose</td>\n",
|
644 |
-
" <td>Denver</td>\n",
|
645 |
-
" <td>42</td>\n",
|
646 |
-
" <td>F0004155</td>\n",
|
647 |
-
" </tr>\n",
|
648 |
-
" <tr>\n",
|
649 |
-
" <th>4156</th>\n",
|
650 |
-
" <td>2022-04-01</td>\n",
|
651 |
-
" <td>14:43</td>\n",
|
652 |
-
" <td>15:32</td>\n",
|
653 |
-
" <td>0 hours 49 minutes</td>\n",
|
654 |
-
" <td>196.0</td>\n",
|
655 |
-
" <td>Montrose</td>\n",
|
656 |
-
" <td>Denver</td>\n",
|
657 |
-
" <td>64</td>\n",
|
658 |
-
" <td>F0004156</td>\n",
|
659 |
-
" </tr>\n",
|
660 |
-
" <tr>\n",
|
661 |
-
" <th>4157</th>\n",
|
662 |
-
" <td>2022-04-01</td>\n",
|
663 |
-
" <td>17:38</td>\n",
|
664 |
-
" <td>18:58</td>\n",
|
665 |
-
" <td>1 hours 20 minutes</td>\n",
|
666 |
-
" <td>196.0</td>\n",
|
667 |
-
" <td>Montrose</td>\n",
|
668 |
-
" <td>Denver</td>\n",
|
669 |
-
" <td>97</td>\n",
|
670 |
-
" <td>F0004157</td>\n",
|
671 |
-
" </tr>\n",
|
672 |
-
" <tr>\n",
|
673 |
-
" <th>7439</th>\n",
|
674 |
-
" <td>2022-04-02</td>\n",
|
675 |
-
" <td>13:38</td>\n",
|
676 |
-
" <td>16:32</td>\n",
|
677 |
-
" <td>1 hours 54 minutes</td>\n",
|
678 |
-
" <td>733.0</td>\n",
|
679 |
-
" <td>Montrose</td>\n",
|
680 |
-
" <td>Dallas</td>\n",
|
681 |
-
" <td>151</td>\n",
|
682 |
-
" <td>F0007439</td>\n",
|
683 |
-
" </tr>\n",
|
684 |
-
" <tr>\n",
|
685 |
-
" <th>7440</th>\n",
|
686 |
-
" <td>2022-04-02</td>\n",
|
687 |
-
" <td>12:37</td>\n",
|
688 |
-
" <td>13:29</td>\n",
|
689 |
-
" <td>0 hours 52 minutes</td>\n",
|
690 |
-
" <td>196.0</td>\n",
|
691 |
-
" <td>Montrose</td>\n",
|
692 |
-
" <td>Denver</td>\n",
|
693 |
-
" <td>54</td>\n",
|
694 |
-
" <td>F0007440</td>\n",
|
695 |
-
" </tr>\n",
|
696 |
-
" <tr>\n",
|
697 |
-
" <th>...</th>\n",
|
698 |
-
" <td>...</td>\n",
|
699 |
-
" <td>...</td>\n",
|
700 |
-
" <td>...</td>\n",
|
701 |
-
" <td>...</td>\n",
|
702 |
-
" <td>...</td>\n",
|
703 |
-
" <td>...</td>\n",
|
704 |
-
" <td>...</td>\n",
|
705 |
-
" <td>...</td>\n",
|
706 |
-
" <td>...</td>\n",
|
707 |
-
" </tr>\n",
|
708 |
-
" <tr>\n",
|
709 |
-
" <th>4045139</th>\n",
|
710 |
-
" <td>2022-03-27</td>\n",
|
711 |
-
" <td>11:50</td>\n",
|
712 |
-
" <td>12:17</td>\n",
|
713 |
-
" <td>1 hours 27 minutes</td>\n",
|
714 |
-
" <td>419.0</td>\n",
|
715 |
-
" <td>Montrose</td>\n",
|
716 |
-
" <td>Phoenix</td>\n",
|
717 |
-
" <td>133</td>\n",
|
718 |
-
" <td>F4045139</td>\n",
|
719 |
-
" </tr>\n",
|
720 |
-
" <tr>\n",
|
721 |
-
" <th>4045140</th>\n",
|
722 |
-
" <td>2022-03-28</td>\n",
|
723 |
-
" <td>11:45</td>\n",
|
724 |
-
" <td>12:22</td>\n",
|
725 |
-
" <td>1 hours 37 minutes</td>\n",
|
726 |
-
" <td>419.0</td>\n",
|
727 |
-
" <td>Montrose</td>\n",
|
728 |
-
" <td>Phoenix</td>\n",
|
729 |
-
" <td>188</td>\n",
|
730 |
-
" <td>F4045140</td>\n",
|
731 |
-
" </tr>\n",
|
732 |
-
" <tr>\n",
|
733 |
-
" <th>4045141</th>\n",
|
734 |
-
" <td>2022-03-29</td>\n",
|
735 |
-
" <td>11:35</td>\n",
|
736 |
-
" <td>12:17</td>\n",
|
737 |
-
" <td>1 hours 42 minutes</td>\n",
|
738 |
-
" <td>419.0</td>\n",
|
739 |
-
" <td>Montrose</td>\n",
|
740 |
-
" <td>Phoenix</td>\n",
|
741 |
-
" <td>144</td>\n",
|
742 |
-
" <td>F4045141</td>\n",
|
743 |
-
" </tr>\n",
|
744 |
-
" <tr>\n",
|
745 |
-
" <th>4045142</th>\n",
|
746 |
-
" <td>2022-03-30</td>\n",
|
747 |
-
" <td>11:38</td>\n",
|
748 |
-
" <td>12:13</td>\n",
|
749 |
-
" <td>1 hours 35 minutes</td>\n",
|
750 |
-
" <td>419.0</td>\n",
|
751 |
-
" <td>Montrose</td>\n",
|
752 |
-
" <td>Phoenix</td>\n",
|
753 |
-
" <td>125</td>\n",
|
754 |
-
" <td>F4045142</td>\n",
|
755 |
-
" </tr>\n",
|
756 |
-
" <tr>\n",
|
757 |
-
" <th>4045143</th>\n",
|
758 |
-
" <td>2022-03-31</td>\n",
|
759 |
-
" <td>11:40</td>\n",
|
760 |
-
" <td>12:19</td>\n",
|
761 |
-
" <td>1 hours 39 minutes</td>\n",
|
762 |
-
" <td>419.0</td>\n",
|
763 |
-
" <td>Montrose</td>\n",
|
764 |
-
" <td>Phoenix</td>\n",
|
765 |
-
" <td>129</td>\n",
|
766 |
-
" <td>F4045143</td>\n",
|
767 |
-
" </tr>\n",
|
768 |
-
" </tbody>\n",
|
769 |
-
"</table>\n",
|
770 |
-
"<p>2035 rows × 9 columns</p>\n",
|
771 |
-
"</div>"
|
772 |
-
],
|
773 |
-
"text/plain": [
|
774 |
-
" FlightDate DepTime ArrTime ActualElapsedTime Distance \n",
|
775 |
-
"4155 2022-04-01 10:42 11:34 0 hours 52 minutes 196.0 \\\n",
|
776 |
-
"4156 2022-04-01 14:43 15:32 0 hours 49 minutes 196.0 \n",
|
777 |
-
"4157 2022-04-01 17:38 18:58 1 hours 20 minutes 196.0 \n",
|
778 |
-
"7439 2022-04-02 13:38 16:32 1 hours 54 minutes 733.0 \n",
|
779 |
-
"7440 2022-04-02 12:37 13:29 0 hours 52 minutes 196.0 \n",
|
780 |
-
"... ... ... ... ... ... \n",
|
781 |
-
"4045139 2022-03-27 11:50 12:17 1 hours 27 minutes 419.0 \n",
|
782 |
-
"4045140 2022-03-28 11:45 12:22 1 hours 37 minutes 419.0 \n",
|
783 |
-
"4045141 2022-03-29 11:35 12:17 1 hours 42 minutes 419.0 \n",
|
784 |
-
"4045142 2022-03-30 11:38 12:13 1 hours 35 minutes 419.0 \n",
|
785 |
-
"4045143 2022-03-31 11:40 12:19 1 hours 39 minutes 419.0 \n",
|
786 |
-
"\n",
|
787 |
-
" OriginCityName DestCityName Price Flight Number \n",
|
788 |
-
"4155 Montrose Denver 42 F0004155 \n",
|
789 |
-
"4156 Montrose Denver 64 F0004156 \n",
|
790 |
-
"4157 Montrose Denver 97 F0004157 \n",
|
791 |
-
"7439 Montrose Dallas 151 F0007439 \n",
|
792 |
-
"7440 Montrose Denver 54 F0007440 \n",
|
793 |
-
"... ... ... ... ... \n",
|
794 |
-
"4045139 Montrose Phoenix 133 F4045139 \n",
|
795 |
-
"4045140 Montrose Phoenix 188 F4045140 \n",
|
796 |
-
"4045141 Montrose Phoenix 144 F4045141 \n",
|
797 |
-
"4045142 Montrose Phoenix 125 F4045142 \n",
|
798 |
-
"4045143 Montrose Phoenix 129 F4045143 \n",
|
799 |
-
"\n",
|
800 |
-
"[2035 rows x 9 columns]"
|
801 |
-
]
|
802 |
-
},
|
803 |
-
"execution_count": 96,
|
804 |
-
"metadata": {},
|
805 |
-
"output_type": "execute_result"
|
806 |
-
}
|
807 |
-
],
|
808 |
-
"source": [
|
809 |
-
"x"
|
810 |
-
]
|
811 |
-
},
|
812 |
-
{
|
813 |
-
"cell_type": "code",
|
814 |
-
"execution_count": 52,
|
815 |
-
"id": "74dfd3cd",
|
816 |
-
"metadata": {},
|
817 |
-
"outputs": [
|
818 |
-
{
|
819 |
-
"data": {
|
820 |
-
"text/html": [
|
821 |
-
"<div>\n",
|
822 |
-
"<style scoped>\n",
|
823 |
-
" .dataframe tbody tr th:only-of-type {\n",
|
824 |
-
" vertical-align: middle;\n",
|
825 |
-
" }\n",
|
826 |
-
"\n",
|
827 |
-
" .dataframe tbody tr th {\n",
|
828 |
-
" vertical-align: top;\n",
|
829 |
-
" }\n",
|
830 |
-
"\n",
|
831 |
-
" .dataframe thead th {\n",
|
832 |
-
" text-align: right;\n",
|
833 |
-
" }\n",
|
834 |
-
"</style>\n",
|
835 |
-
"<table border=\"1\" class=\"dataframe\">\n",
|
836 |
-
" <thead>\n",
|
837 |
-
" <tr style=\"text-align: right;\">\n",
|
838 |
-
" <th></th>\n",
|
839 |
-
" <th>FlightDate</th>\n",
|
840 |
-
" <th>DepTime</th>\n",
|
841 |
-
" <th>ArrTime</th>\n",
|
842 |
-
" <th>ActualElapsedTime</th>\n",
|
843 |
-
" <th>Distance</th>\n",
|
844 |
-
" <th>OriginCityName</th>\n",
|
845 |
-
" <th>DestCityName</th>\n",
|
846 |
-
" <th>Price</th>\n",
|
847 |
-
" </tr>\n",
|
848 |
-
" </thead>\n",
|
849 |
-
" <tbody>\n",
|
850 |
-
" <tr>\n",
|
851 |
-
" <th>1369</th>\n",
|
852 |
-
" <td>2022-04-01</td>\n",
|
853 |
-
" <td>09:04</td>\n",
|
854 |
-
" <td>10:23</td>\n",
|
855 |
-
" <td>1 hours 19 minutes</td>\n",
|
856 |
-
" <td>229.0</td>\n",
|
857 |
-
" <td>Washington</td>\n",
|
858 |
-
" <td>New York</td>\n",
|
859 |
-
" <td>105</td>\n",
|
860 |
-
" </tr>\n",
|
861 |
-
" <tr>\n",
|
862 |
-
" <th>1370</th>\n",
|
863 |
-
" <td>2022-04-01</td>\n",
|
864 |
-
" <td>11:07</td>\n",
|
865 |
-
" <td>12:29</td>\n",
|
866 |
-
" <td>1 hours 22 minutes</td>\n",
|
867 |
-
" <td>229.0</td>\n",
|
868 |
-
" <td>Washington</td>\n",
|
869 |
-
" <td>New York</td>\n",
|
870 |
-
" <td>56</td>\n",
|
871 |
-
" </tr>\n",
|
872 |
-
" <tr>\n",
|
873 |
-
" <th>1380</th>\n",
|
874 |
-
" <td>2022-04-01</td>\n",
|
875 |
-
" <td>13:20</td>\n",
|
876 |
-
" <td>14:52</td>\n",
|
877 |
-
" <td>1 hours 32 minutes</td>\n",
|
878 |
-
" <td>229.0</td>\n",
|
879 |
-
" <td>Washington</td>\n",
|
880 |
-
" <td>New York</td>\n",
|
881 |
-
" <td>95</td>\n",
|
882 |
-
" </tr>\n",
|
883 |
-
" <tr>\n",
|
884 |
-
" <th>1409</th>\n",
|
885 |
-
" <td>2022-04-01</td>\n",
|
886 |
-
" <td>19:03</td>\n",
|
887 |
-
" <td>20:23</td>\n",
|
888 |
-
" <td>1 hours 20 minutes</td>\n",
|
889 |
-
" <td>229.0</td>\n",
|
890 |
-
" <td>Washington</td>\n",
|
891 |
-
" <td>New York</td>\n",
|
892 |
-
" <td>71</td>\n",
|
893 |
-
" </tr>\n",
|
894 |
-
" <tr>\n",
|
895 |
-
" <th>1436</th>\n",
|
896 |
-
" <td>2022-04-01</td>\n",
|
897 |
-
" <td>15:32</td>\n",
|
898 |
-
" <td>17:03</td>\n",
|
899 |
-
" <td>1 hours 31 minutes</td>\n",
|
900 |
-
" <td>229.0</td>\n",
|
901 |
-
" <td>Washington</td>\n",
|
902 |
-
" <td>New York</td>\n",
|
903 |
-
" <td>64</td>\n",
|
904 |
-
" </tr>\n",
|
905 |
-
" <tr>\n",
|
906 |
-
" <th>...</th>\n",
|
907 |
-
" <td>...</td>\n",
|
908 |
-
" <td>...</td>\n",
|
909 |
-
" <td>...</td>\n",
|
910 |
-
" <td>...</td>\n",
|
911 |
-
" <td>...</td>\n",
|
912 |
-
" <td>...</td>\n",
|
913 |
-
" <td>...</td>\n",
|
914 |
-
" <td>...</td>\n",
|
915 |
-
" </tr>\n",
|
916 |
-
" <tr>\n",
|
917 |
-
" <th>565444</th>\n",
|
918 |
-
" <td>2022-04-01</td>\n",
|
919 |
-
" <td>22:55</td>\n",
|
920 |
-
" <td>07:09</td>\n",
|
921 |
-
" <td>5 hours 14 minutes</td>\n",
|
922 |
-
" <td>2475.0</td>\n",
|
923 |
-
" <td>Los Angeles</td>\n",
|
924 |
-
" <td>New York</td>\n",
|
925 |
-
" <td>621</td>\n",
|
926 |
-
" </tr>\n",
|
927 |
-
" <tr>\n",
|
928 |
-
" <th>565446</th>\n",
|
929 |
-
" <td>2022-04-01</td>\n",
|
930 |
-
" <td>11:39</td>\n",
|
931 |
-
" <td>19:49</td>\n",
|
932 |
-
" <td>5 hours 10 minutes</td>\n",
|
933 |
-
" <td>2475.0</td>\n",
|
934 |
-
" <td>Los Angeles</td>\n",
|
935 |
-
" <td>New York</td>\n",
|
936 |
-
" <td>1100</td>\n",
|
937 |
-
" </tr>\n",
|
938 |
-
" <tr>\n",
|
939 |
-
" <th>565511</th>\n",
|
940 |
-
" <td>2022-04-01</td>\n",
|
941 |
-
" <td>15:48</td>\n",
|
942 |
-
" <td>22:16</td>\n",
|
943 |
-
" <td>4 hours 28 minutes</td>\n",
|
944 |
-
" <td>1620.0</td>\n",
|
945 |
-
" <td>Denver</td>\n",
|
946 |
-
" <td>New York</td>\n",
|
947 |
-
" <td>575</td>\n",
|
948 |
-
" </tr>\n",
|
949 |
-
" <tr>\n",
|
950 |
-
" <th>565541</th>\n",
|
951 |
-
" <td>2022-04-01</td>\n",
|
952 |
-
" <td>17:36</td>\n",
|
953 |
-
" <td>23:05</td>\n",
|
954 |
-
" <td>3 hours 29 minutes</td>\n",
|
955 |
-
" <td>1620.0</td>\n",
|
956 |
-
" <td>Denver</td>\n",
|
957 |
-
" <td>New York</td>\n",
|
958 |
-
" <td>669</td>\n",
|
959 |
-
" </tr>\n",
|
960 |
-
" <tr>\n",
|
961 |
-
" <th>565581</th>\n",
|
962 |
-
" <td>2022-04-01</td>\n",
|
963 |
-
" <td>20:52</td>\n",
|
964 |
-
" <td>23:48</td>\n",
|
965 |
-
" <td>1 hours 56 minutes</td>\n",
|
966 |
-
" <td>733.0</td>\n",
|
967 |
-
" <td>Chicago</td>\n",
|
968 |
-
" <td>New York</td>\n",
|
969 |
-
" <td>338</td>\n",
|
970 |
-
" </tr>\n",
|
971 |
-
" </tbody>\n",
|
972 |
-
"</table>\n",
|
973 |
-
"<p>889 rows × 8 columns</p>\n",
|
974 |
-
"</div>"
|
975 |
-
],
|
976 |
-
"text/plain": [
|
977 |
-
" FlightDate DepTime ArrTime ActualElapsedTime Distance \n",
|
978 |
-
"1369 2022-04-01 09:04 10:23 1 hours 19 minutes 229.0 \\\n",
|
979 |
-
"1370 2022-04-01 11:07 12:29 1 hours 22 minutes 229.0 \n",
|
980 |
-
"1380 2022-04-01 13:20 14:52 1 hours 32 minutes 229.0 \n",
|
981 |
-
"1409 2022-04-01 19:03 20:23 1 hours 20 minutes 229.0 \n",
|
982 |
-
"1436 2022-04-01 15:32 17:03 1 hours 31 minutes 229.0 \n",
|
983 |
-
"... ... ... ... ... ... \n",
|
984 |
-
"565444 2022-04-01 22:55 07:09 5 hours 14 minutes 2475.0 \n",
|
985 |
-
"565446 2022-04-01 11:39 19:49 5 hours 10 minutes 2475.0 \n",
|
986 |
-
"565511 2022-04-01 15:48 22:16 4 hours 28 minutes 1620.0 \n",
|
987 |
-
"565541 2022-04-01 17:36 23:05 3 hours 29 minutes 1620.0 \n",
|
988 |
-
"565581 2022-04-01 20:52 23:48 1 hours 56 minutes 733.0 \n",
|
989 |
-
"\n",
|
990 |
-
" OriginCityName DestCityName Price \n",
|
991 |
-
"1369 Washington New York 105 \n",
|
992 |
-
"1370 Washington New York 56 \n",
|
993 |
-
"1380 Washington New York 95 \n",
|
994 |
-
"1409 Washington New York 71 \n",
|
995 |
-
"1436 Washington New York 64 \n",
|
996 |
-
"... ... ... ... \n",
|
997 |
-
"565444 Los Angeles New York 621 \n",
|
998 |
-
"565446 Los Angeles New York 1100 \n",
|
999 |
-
"565511 Denver New York 575 \n",
|
1000 |
-
"565541 Denver New York 669 \n",
|
1001 |
-
"565581 Chicago New York 338 \n",
|
1002 |
-
"\n",
|
1003 |
-
"[889 rows x 8 columns]"
|
1004 |
-
]
|
1005 |
-
},
|
1006 |
-
"execution_count": 52,
|
1007 |
-
"metadata": {},
|
1008 |
-
"output_type": "execute_result"
|
1009 |
-
}
|
1010 |
-
],
|
1011 |
-
"source": [
|
1012 |
-
"x[x['FlightDate']=='2022-04-01']"
|
1013 |
-
]
|
1014 |
-
},
|
1015 |
-
{
|
1016 |
-
"cell_type": "code",
|
1017 |
-
"execution_count": 58,
|
1018 |
-
"id": "93c2a26f",
|
1019 |
-
"metadata": {},
|
1020 |
-
"outputs": [
|
1021 |
-
{
|
1022 |
-
"name": "stdout",
|
1023 |
-
"output_type": "stream",
|
1024 |
-
"text": [
|
1025 |
-
"['Manhattan', 'Ft. Riley']\n"
|
1026 |
-
]
|
1027 |
-
}
|
1028 |
-
],
|
1029 |
-
"source": [
|
1030 |
-
"print('Manhattan/Ft. Riley'.split('/'))"
|
1031 |
-
]
|
1032 |
-
},
|
1033 |
-
{
|
1034 |
-
"cell_type": "code",
|
1035 |
-
"execution_count": null,
|
1036 |
-
"id": "86b394bf",
|
1037 |
-
"metadata": {},
|
1038 |
-
"outputs": [],
|
1039 |
-
"source": []
|
1040 |
-
}
|
1041 |
-
],
|
1042 |
-
"metadata": {
|
1043 |
-
"kernelspec": {
|
1044 |
-
"display_name": "Python 3 (ipykernel)",
|
1045 |
-
"language": "python",
|
1046 |
-
"name": "python3"
|
1047 |
-
},
|
1048 |
-
"language_info": {
|
1049 |
-
"codemirror_mode": {
|
1050 |
-
"name": "ipython",
|
1051 |
-
"version": 3
|
1052 |
-
},
|
1053 |
-
"file_extension": ".py",
|
1054 |
-
"mimetype": "text/x-python",
|
1055 |
-
"name": "python",
|
1056 |
-
"nbconvert_exporter": "python",
|
1057 |
-
"pygments_lexer": "ipython3",
|
1058 |
-
"version": "3.9.16"
|
1059 |
-
}
|
1060 |
-
},
|
1061 |
-
"nbformat": 4,
|
1062 |
-
"nbformat_minor": 5
|
1063 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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