{
"cells": [
{
"cell_type": "code",
"execution_count": 8,
"id": "041c9721",
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"data = pd.read_csv('/home/xj/toolAugEnv/code/toolConstraint/database/flights/Combined_Flights_2022.csv')\n",
"# df.to_csv('/home/xj/toolAugEnv/code/toolConstraint/database/flights/clean_Flights_2022.csv')"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "03d0f39e",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" FlightDate | \n",
" Airline | \n",
" Origin | \n",
" Dest | \n",
" Cancelled | \n",
" Diverted | \n",
" CRSDepTime | \n",
" DepTime | \n",
" DepDelayMinutes | \n",
" DepDelay | \n",
" ... | \n",
" WheelsOff | \n",
" WheelsOn | \n",
" TaxiIn | \n",
" CRSArrTime | \n",
" ArrDelay | \n",
" ArrDel15 | \n",
" ArrivalDelayGroups | \n",
" ArrTimeBlk | \n",
" DistanceGroup | \n",
" DivAirportLandings | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 2022-04-04 | \n",
" Commutair Aka Champlain Enterprises, Inc. | \n",
" GJT | \n",
" DEN | \n",
" False | \n",
" False | \n",
" 1133 | \n",
" 1123.0 | \n",
" 0.0 | \n",
" -10.0 | \n",
" ... | \n",
" 1140.0 | \n",
" 1220.0 | \n",
" 8.0 | \n",
" 1245 | \n",
" -17.0 | \n",
" 0.0 | \n",
" -2.0 | \n",
" 1200-1259 | \n",
" 1 | \n",
" 0 | \n",
"
\n",
" \n",
" 1 | \n",
" 2022-04-04 | \n",
" Commutair Aka Champlain Enterprises, Inc. | \n",
" HRL | \n",
" IAH | \n",
" False | \n",
" False | \n",
" 732 | \n",
" 728.0 | \n",
" 0.0 | \n",
" -4.0 | \n",
" ... | \n",
" 744.0 | \n",
" 839.0 | \n",
" 9.0 | \n",
" 849 | \n",
" -1.0 | \n",
" 0.0 | \n",
" -1.0 | \n",
" 0800-0859 | \n",
" 2 | \n",
" 0 | \n",
"
\n",
" \n",
" 2 | \n",
" 2022-04-04 | \n",
" Commutair Aka Champlain Enterprises, Inc. | \n",
" DRO | \n",
" DEN | \n",
" False | \n",
" False | \n",
" 1529 | \n",
" 1514.0 | \n",
" 0.0 | \n",
" -15.0 | \n",
" ... | \n",
" 1535.0 | \n",
" 1622.0 | \n",
" 14.0 | \n",
" 1639 | \n",
" -3.0 | \n",
" 0.0 | \n",
" -1.0 | \n",
" 1600-1659 | \n",
" 2 | \n",
" 0 | \n",
"
\n",
" \n",
" 3 | \n",
" 2022-04-04 | \n",
" Commutair Aka Champlain Enterprises, Inc. | \n",
" IAH | \n",
" GPT | \n",
" False | \n",
" False | \n",
" 1435 | \n",
" 1430.0 | \n",
" 0.0 | \n",
" -5.0 | \n",
" ... | \n",
" 1446.0 | \n",
" 1543.0 | \n",
" 4.0 | \n",
" 1605 | \n",
" -18.0 | \n",
" 0.0 | \n",
" -2.0 | \n",
" 1600-1659 | \n",
" 2 | \n",
" 0 | \n",
"
\n",
" \n",
" 4 | \n",
" 2022-04-04 | \n",
" Commutair Aka Champlain Enterprises, Inc. | \n",
" DRO | \n",
" DEN | \n",
" False | \n",
" False | \n",
" 1135 | \n",
" 1135.0 | \n",
" 0.0 | \n",
" 0.0 | \n",
" ... | \n",
" 1154.0 | \n",
" 1243.0 | \n",
" 8.0 | \n",
" 1245 | \n",
" 6.0 | \n",
" 0.0 | \n",
" 0.0 | \n",
" 1200-1259 | \n",
" 2 | \n",
" 0 | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 4078313 | \n",
" 2022-03-31 | \n",
" Republic Airlines | \n",
" MSY | \n",
" EWR | \n",
" False | \n",
" True | \n",
" 1949 | \n",
" 2014.0 | \n",
" 25.0 | \n",
" 25.0 | \n",
" ... | \n",
" 2031.0 | \n",
" 202.0 | \n",
" 32.0 | \n",
" 2354 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 2300-2359 | \n",
" 5 | \n",
" 1 | \n",
"
\n",
" \n",
" 4078314 | \n",
" 2022-03-17 | \n",
" Republic Airlines | \n",
" CLT | \n",
" EWR | \n",
" True | \n",
" False | \n",
" 1733 | \n",
" 1817.0 | \n",
" 44.0 | \n",
" 44.0 | \n",
" ... | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 1942 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 1900-1959 | \n",
" 3 | \n",
" 0 | \n",
"
\n",
" \n",
" 4078315 | \n",
" 2022-03-08 | \n",
" Republic Airlines | \n",
" ALB | \n",
" ORD | \n",
" False | \n",
" False | \n",
" 1700 | \n",
" 2318.0 | \n",
" 378.0 | \n",
" 378.0 | \n",
" ... | \n",
" 2337.0 | \n",
" 52.0 | \n",
" 7.0 | \n",
" 1838 | \n",
" 381.0 | \n",
" 1.0 | \n",
" 12.0 | \n",
" 1800-1859 | \n",
" 3 | \n",
" 0 | \n",
"
\n",
" \n",
" 4078316 | \n",
" 2022-03-25 | \n",
" Republic Airlines | \n",
" EWR | \n",
" PIT | \n",
" False | \n",
" True | \n",
" 2129 | \n",
" 2322.0 | \n",
" 113.0 | \n",
" 113.0 | \n",
" ... | \n",
" 2347.0 | \n",
" 933.0 | \n",
" 6.0 | \n",
" 2255 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 2200-2259 | \n",
" 2 | \n",
" 1 | \n",
"
\n",
" \n",
" 4078317 | \n",
" 2022-03-07 | \n",
" Republic Airlines | \n",
" EWR | \n",
" RDU | \n",
" False | \n",
" True | \n",
" 1154 | \n",
" 1148.0 | \n",
" 0.0 | \n",
" -6.0 | \n",
" ... | \n",
" 1201.0 | \n",
" 1552.0 | \n",
" 4.0 | \n",
" 1333 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 1300-1359 | \n",
" 2 | \n",
" 1 | \n",
"
\n",
" \n",
"
\n",
"
4078318 rows × 61 columns
\n",
"
"
],
"text/plain": [
" FlightDate Airline Origin Dest \n",
"0 2022-04-04 Commutair Aka Champlain Enterprises, Inc. GJT DEN \\\n",
"1 2022-04-04 Commutair Aka Champlain Enterprises, Inc. HRL IAH \n",
"2 2022-04-04 Commutair Aka Champlain Enterprises, Inc. DRO DEN \n",
"3 2022-04-04 Commutair Aka Champlain Enterprises, Inc. IAH GPT \n",
"4 2022-04-04 Commutair Aka Champlain Enterprises, Inc. DRO DEN \n",
"... ... ... ... ... \n",
"4078313 2022-03-31 Republic Airlines MSY EWR \n",
"4078314 2022-03-17 Republic Airlines CLT EWR \n",
"4078315 2022-03-08 Republic Airlines ALB ORD \n",
"4078316 2022-03-25 Republic Airlines EWR PIT \n",
"4078317 2022-03-07 Republic Airlines EWR RDU \n",
"\n",
" Cancelled Diverted CRSDepTime DepTime DepDelayMinutes DepDelay \n",
"0 False False 1133 1123.0 0.0 -10.0 \\\n",
"1 False False 732 728.0 0.0 -4.0 \n",
"2 False False 1529 1514.0 0.0 -15.0 \n",
"3 False False 1435 1430.0 0.0 -5.0 \n",
"4 False False 1135 1135.0 0.0 0.0 \n",
"... ... ... ... ... ... ... \n",
"4078313 False True 1949 2014.0 25.0 25.0 \n",
"4078314 True False 1733 1817.0 44.0 44.0 \n",
"4078315 False False 1700 2318.0 378.0 378.0 \n",
"4078316 False True 2129 2322.0 113.0 113.0 \n",
"4078317 False True 1154 1148.0 0.0 -6.0 \n",
"\n",
" ... WheelsOff WheelsOn TaxiIn CRSArrTime ArrDelay ArrDel15 \n",
"0 ... 1140.0 1220.0 8.0 1245 -17.0 0.0 \\\n",
"1 ... 744.0 839.0 9.0 849 -1.0 0.0 \n",
"2 ... 1535.0 1622.0 14.0 1639 -3.0 0.0 \n",
"3 ... 1446.0 1543.0 4.0 1605 -18.0 0.0 \n",
"4 ... 1154.0 1243.0 8.0 1245 6.0 0.0 \n",
"... ... ... ... ... ... ... ... \n",
"4078313 ... 2031.0 202.0 32.0 2354 NaN NaN \n",
"4078314 ... NaN NaN NaN 1942 NaN NaN \n",
"4078315 ... 2337.0 52.0 7.0 1838 381.0 1.0 \n",
"4078316 ... 2347.0 933.0 6.0 2255 NaN NaN \n",
"4078317 ... 1201.0 1552.0 4.0 1333 NaN NaN \n",
"\n",
" ArrivalDelayGroups ArrTimeBlk DistanceGroup DivAirportLandings \n",
"0 -2.0 1200-1259 1 0 \n",
"1 -1.0 0800-0859 2 0 \n",
"2 -1.0 1600-1659 2 0 \n",
"3 -2.0 1600-1659 2 0 \n",
"4 0.0 1200-1259 2 0 \n",
"... ... ... ... ... \n",
"4078313 NaN 2300-2359 5 1 \n",
"4078314 NaN 1900-1959 3 0 \n",
"4078315 12.0 1800-1859 3 0 \n",
"4078316 NaN 2200-2259 2 1 \n",
"4078317 NaN 1300-1359 2 1 \n",
"\n",
"[4078318 rows x 61 columns]"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "036418f5",
"metadata": {},
"outputs": [],
"source": [
"data_dict = data.to_dict(orient = 'split')"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "371a85fd",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"4078318\n"
]
}
],
"source": [
"print(len(data_dict['data']))"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "64d46483",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"FlightDate 0\n",
"DepTime 7\n",
"ArrTime 10\n",
"ActualElapsedTime 14\n",
"Distance 15\n",
"OriginCityName 34\n",
"DestCityName 42\n"
]
}
],
"source": [
"for idx,unit in enumerate(data_dict['columns']):\n",
" if unit in ['FlightDate','DepTime','ArrTime','ActualElapsedTime','Distance','OriginCityName','DestCityName']:\n",
" print(unit, str(idx))"
]
},
{
"cell_type": "code",
"execution_count": 27,
"id": "81047adf",
"metadata": {},
"outputs": [],
"source": [
"import math\n",
"def convert_to_hhmm(time_float):\n",
" \"\"\"\n",
" Convert a float time to hh:mm format\n",
" :param time_float: Time as a float. Example: 757.0\n",
" :return: Time in hh:mm format. Example: \"07:57\"\n",
" \"\"\"\n",
" try:\n",
" hours = int(time_float // 100)\n",
" minutes = int(time_float % 100)\n",
" return \"{:02d}:{:02d}\".format(hours, minutes)\n",
" except:\n",
" return time_float\n",
"\n",
"def minutes_to_hours_minutes(minutes):\n",
" # Check for NaN and handle it\n",
" if math.isnan(minutes):\n",
" return \"NaN\"\n",
" \n",
" # Ensure minutes is an integer or rounded to the nearest integer\n",
" minutes = round(minutes)\n",
" \n",
" hours = minutes // 60\n",
" remaining_minutes = minutes % 60\n",
" return f\"{hours} hours {remaining_minutes} minutes\""
]
},
{
"cell_type": "code",
"execution_count": 33,
"id": "ee34cbde",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "15392917a93840e6b66e7e457d404721",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"0it [00:00, ?it/s]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from tqdm.autonotebook import tqdm\n",
"import random\n",
"new_data = []\n",
"for idx, unit in tqdm(enumerate(data_dict['data'])):\n",
" tmp_dict = {k:\"\" for k in ['FlightDate','DepTime','ArrTime','ActualElapsedTime','Distance','OriginCityName','DestCityName','Price']}\n",
" tmp_dict['FlightDate'] = unit[0]\n",
" tmp_dict['DepTime'] = convert_to_hhmm(unit[7])\n",
" tmp_dict['ArrTime'] = convert_to_hhmm(unit[10])\n",
" tmp_dict['ActualElapsedTime'] = minutes_to_hours_minutes(unit[14])\n",
" tmp_dict['Distance'] = unit[15]\n",
" tmp_dict['OriginCityName'] = unit[34].split(',')[0].split('\\\\')[0]\n",
" tmp_dict['DestCityName'] = unit[42].split(',')[0].split('\\\\')[0]\n",
" tmp_dict['Price'] = int((unit[15]) * random.uniform(0.2,0.5))\n",
" new_data.append(tmp_dict)"
]
},
{
"cell_type": "code",
"execution_count": 34,
"id": "aee3f422",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'FlightDate': '2022-04-04',\n",
" 'DepTime': '09:27',\n",
" 'ArrTime': '11:19',\n",
" 'ActualElapsedTime': '1 hours 52 minutes',\n",
" 'Distance': 466.0,\n",
" 'OriginCityName': 'Chicago',\n",
" 'DestCityName': 'Lincoln',\n",
" 'Price': 119}"
]
},
"execution_count": 34,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"new_data[200]"
]
},
{
"cell_type": "code",
"execution_count": 35,
"id": "bfb243c0",
"metadata": {},
"outputs": [],
"source": [
"df = pd.DataFrame(new_data)"
]
},
{
"cell_type": "code",
"execution_count": 40,
"id": "f152a150",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" FlightDate | \n",
" DepTime | \n",
" ArrTime | \n",
" ActualElapsedTime | \n",
" Distance | \n",
" OriginCityName | \n",
" DestCityName | \n",
" Price | \n",
"
\n",
" \n",
" \n",
" \n",
" 3488394 | \n",
" 2022-03-01 | \n",
" 07:24 | \n",
" 15:15 | \n",
" 4 hours 51 minutes | \n",
" 2422.0 | \n",
" Seattle | \n",
" New York | \n",
" 566 | \n",
"
\n",
" \n",
" 3509382 | \n",
" 2022-03-01 | \n",
" 22:29 | \n",
" 06:07 | \n",
" 4 hours 38 minutes | \n",
" 2422.0 | \n",
" Seattle | \n",
" New York | \n",
" 692 | \n",
"
\n",
" \n",
" 3736056 | \n",
" 2022-03-01 | \n",
" 23:33 | \n",
" 07:16 | \n",
" 4 hours 43 minutes | \n",
" 2422.0 | \n",
" Seattle | \n",
" New York | \n",
" 510 | \n",
"
\n",
" \n",
" 3736260 | \n",
" 2022-03-01 | \n",
" 14:37 | \n",
" 22:05 | \n",
" 4 hours 28 minutes | \n",
" 2422.0 | \n",
" Seattle | \n",
" New York | \n",
" 1135 | \n",
"
\n",
" \n",
" 3736313 | \n",
" 2022-03-01 | \n",
" 09:11 | \n",
" 17:17 | \n",
" 5 hours 6 minutes | \n",
" 2422.0 | \n",
" Seattle | \n",
" New York | \n",
" 627 | \n",
"
\n",
" \n",
" 3776858 | \n",
" 2022-03-01 | \n",
" 21:01 | \n",
" 04:32 | \n",
" 4 hours 31 minutes | \n",
" 2422.0 | \n",
" Seattle | \n",
" New York | \n",
" 981 | \n",
"
\n",
" \n",
" 3778565 | \n",
" 2022-03-01 | \n",
" 13:18 | \n",
" 21:08 | \n",
" 4 hours 50 minutes | \n",
" 2422.0 | \n",
" Seattle | \n",
" New York | \n",
" 869 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" FlightDate DepTime ArrTime ActualElapsedTime Distance \n",
"3488394 2022-03-01 07:24 15:15 4 hours 51 minutes 2422.0 \\\n",
"3509382 2022-03-01 22:29 06:07 4 hours 38 minutes 2422.0 \n",
"3736056 2022-03-01 23:33 07:16 4 hours 43 minutes 2422.0 \n",
"3736260 2022-03-01 14:37 22:05 4 hours 28 minutes 2422.0 \n",
"3736313 2022-03-01 09:11 17:17 5 hours 6 minutes 2422.0 \n",
"3776858 2022-03-01 21:01 04:32 4 hours 31 minutes 2422.0 \n",
"3778565 2022-03-01 13:18 21:08 4 hours 50 minutes 2422.0 \n",
"\n",
" OriginCityName DestCityName Price \n",
"3488394 Seattle New York 566 \n",
"3509382 Seattle New York 692 \n",
"3736056 Seattle New York 510 \n",
"3736260 Seattle New York 1135 \n",
"3736313 Seattle New York 627 \n",
"3776858 Seattle New York 981 \n",
"3778565 Seattle New York 869 "
]
},
"execution_count": 40,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df[(df['OriginCityName']=='Seattle') & (df['DestCityName']=='New York')& (df['FlightDate']=='2022-03-01')]"
]
},
{
"cell_type": "code",
"execution_count": 37,
"id": "af7e3411",
"metadata": {},
"outputs": [],
"source": [
"df.to_csv('/home/xj/toolAugEnv/code/toolConstraint/database/flights/clean_Flights_2022_2.csv')"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "461e83ef",
"metadata": {},
"outputs": [],
"source": [
"x = df[df['OriginCityName']=='Los Angeles']"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "ed4e2107",
"metadata": {},
"outputs": [],
"source": [
"x = x[x['DestCityName']=='New York']"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "56c918e3",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" FlightDate | \n",
" DepTime | \n",
" ArrTime | \n",
" Distance | \n",
" OriginCityName | \n",
" DestCityName | \n",
" Price | \n",
"
\n",
" \n",
" \n",
" \n",
" 165345 | \n",
" 2022-04-01 | \n",
" 07:57 | \n",
" 16:28 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 1121 | \n",
"
\n",
" \n",
" 165346 | \n",
" 2022-04-02 | \n",
" 07:59 | \n",
" 16:21 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 1035 | \n",
"
\n",
" \n",
" 165347 | \n",
" 2022-04-03 | \n",
" 07:54 | \n",
" 16:04 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 1143 | \n",
"
\n",
" \n",
" 165348 | \n",
" 2022-04-04 | \n",
" 07:55 | \n",
" 16:53 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 1095 | \n",
"
\n",
" \n",
" 165349 | \n",
" 2022-04-05 | \n",
" 07:25 | \n",
" 15:39 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 564 | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 3912574 | \n",
" 2022-03-16 | \n",
" 07:13 | \n",
" 15:14 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 1037 | \n",
"
\n",
" \n",
" 3915112 | \n",
" 2022-03-02 | \n",
" 14:24 | \n",
" 22:30 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 716 | \n",
"
\n",
" \n",
" 3915114 | \n",
" 2022-03-02 | \n",
" 07:10 | \n",
" 15:03 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 554 | \n",
"
\n",
" \n",
" 3916767 | \n",
" 2022-03-01 | \n",
" 14:34 | \n",
" 22:33 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 853 | \n",
"
\n",
" \n",
" 3916769 | \n",
" 2022-03-01 | \n",
" 07:07 | \n",
" 15:07 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 863 | \n",
"
\n",
" \n",
"
\n",
"
5913 rows × 7 columns
\n",
"
"
],
"text/plain": [
" FlightDate DepTime ArrTime Distance OriginCityName DestCityName \n",
"165345 2022-04-01 07:57 16:28 2475.0 Los Angeles New York \\\n",
"165346 2022-04-02 07:59 16:21 2475.0 Los Angeles New York \n",
"165347 2022-04-03 07:54 16:04 2475.0 Los Angeles New York \n",
"165348 2022-04-04 07:55 16:53 2475.0 Los Angeles New York \n",
"165349 2022-04-05 07:25 15:39 2475.0 Los Angeles New York \n",
"... ... ... ... ... ... ... \n",
"3912574 2022-03-16 07:13 15:14 2475.0 Los Angeles New York \n",
"3915112 2022-03-02 14:24 22:30 2475.0 Los Angeles New York \n",
"3915114 2022-03-02 07:10 15:03 2475.0 Los Angeles New York \n",
"3916767 2022-03-01 14:34 22:33 2475.0 Los Angeles New York \n",
"3916769 2022-03-01 07:07 15:07 2475.0 Los Angeles New York \n",
"\n",
" Price \n",
"165345 1121 \n",
"165346 1035 \n",
"165347 1143 \n",
"165348 1095 \n",
"165349 564 \n",
"... ... \n",
"3912574 1037 \n",
"3915112 716 \n",
"3915114 554 \n",
"3916767 853 \n",
"3916769 863 \n",
"\n",
"[5913 rows x 7 columns]"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"x"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "74dfd3cd",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" FlightDate | \n",
" DepTime | \n",
" ArrTime | \n",
" Distance | \n",
" OriginCityName | \n",
" DestCityName | \n",
" Price | \n",
"
\n",
" \n",
" \n",
" \n",
" 165345 | \n",
" 2022-04-01 | \n",
" 07:57 | \n",
" 16:28 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 1121 | \n",
"
\n",
" \n",
" 165405 | \n",
" 2022-04-01 | \n",
" 06:07 | \n",
" 14:25 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 572 | \n",
"
\n",
" \n",
" 165576 | \n",
" 2022-04-01 | \n",
" 22:58 | \n",
" 07:15 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 929 | \n",
"
\n",
" \n",
" 165636 | \n",
" 2022-04-01 | \n",
" 13:28 | \n",
" 21:36 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 950 | \n",
"
\n",
" \n",
" 165868 | \n",
" 2022-04-01 | \n",
" 06:39 | \n",
" 14:46 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 965 | \n",
"
\n",
" \n",
" 166137 | \n",
" 2022-04-01 | \n",
" 16:10 | \n",
" 00:23 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 794 | \n",
"
\n",
" \n",
" 166258 | \n",
" 2022-04-01 | \n",
" 10:57 | \n",
" 19:13 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 578 | \n",
"
\n",
" \n",
" 166433 | \n",
" 2022-04-01 | \n",
" 12:35 | \n",
" 20:54 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 984 | \n",
"
\n",
" \n",
" 166761 | \n",
" 2022-04-01 | \n",
" 07:52 | \n",
" 16:05 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 1165 | \n",
"
\n",
" \n",
" 261306 | \n",
" 2022-04-01 | \n",
" 11:24 | \n",
" 20:02 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 1201 | \n",
"
\n",
" \n",
" 261369 | \n",
" 2022-04-01 | \n",
" 13:57 | \n",
" 22:19 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 501 | \n",
"
\n",
" \n",
" 279321 | \n",
" 2022-04-01 | \n",
" 15:16 | \n",
" 23:26 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 1162 | \n",
"
\n",
" \n",
" 279322 | \n",
" 2022-04-01 | \n",
" 00:56 | \n",
" 09:18 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 1169 | \n",
"
\n",
" \n",
" 279545 | \n",
" 2022-04-01 | \n",
" 00:38 | \n",
" 08:49 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 919 | \n",
"
\n",
" \n",
" 280912 | \n",
" 2022-04-01 | \n",
" 09:01 | \n",
" 17:35 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 757 | \n",
"
\n",
" \n",
" 281749 | \n",
" 2022-04-01 | \n",
" 06:52 | \n",
" 15:22 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 992 | \n",
"
\n",
" \n",
" 281963 | \n",
" 2022-04-01 | \n",
" 17:13 | \n",
" 01:27 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 981 | \n",
"
\n",
" \n",
" 282457 | \n",
" 2022-04-01 | \n",
" 13:20 | \n",
" 21:37 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 980 | \n",
"
\n",
" \n",
" 284103 | \n",
" 2022-04-01 | \n",
" 13:18 | \n",
" 21:56 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 899 | \n",
"
\n",
" \n",
" 284133 | \n",
" 2022-04-01 | \n",
" 07:42 | \n",
" 15:35 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 1232 | \n",
"
\n",
" \n",
" 284233 | \n",
" 2022-04-01 | \n",
" 21:43 | \n",
" 05:43 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 749 | \n",
"
\n",
" \n",
" 286051 | \n",
" 2022-04-01 | \n",
" 09:26 | \n",
" 17:35 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 1116 | \n",
"
\n",
" \n",
" 287421 | \n",
" 2022-04-01 | \n",
" 16:56 | \n",
" 01:00 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 1033 | \n",
"
\n",
" \n",
" 288677 | \n",
" 2022-04-01 | \n",
" 12:35 | \n",
" NaN | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 760 | \n",
"
\n",
" \n",
" 325934 | \n",
" 2022-04-01 | \n",
" 23:25 | \n",
" 07:17 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 588 | \n",
"
\n",
" \n",
" 331405 | \n",
" 2022-04-01 | \n",
" 06:05 | \n",
" 14:29 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 746 | \n",
"
\n",
" \n",
" 565444 | \n",
" 2022-04-01 | \n",
" 22:55 | \n",
" 07:09 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 654 | \n",
"
\n",
" \n",
" 565446 | \n",
" 2022-04-01 | \n",
" 11:39 | \n",
" 19:49 | \n",
" 2475.0 | \n",
" Los Angeles | \n",
" New York | \n",
" 616 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" FlightDate DepTime ArrTime Distance OriginCityName DestCityName \n",
"165345 2022-04-01 07:57 16:28 2475.0 Los Angeles New York \\\n",
"165405 2022-04-01 06:07 14:25 2475.0 Los Angeles New York \n",
"165576 2022-04-01 22:58 07:15 2475.0 Los Angeles New York \n",
"165636 2022-04-01 13:28 21:36 2475.0 Los Angeles New York \n",
"165868 2022-04-01 06:39 14:46 2475.0 Los Angeles New York \n",
"166137 2022-04-01 16:10 00:23 2475.0 Los Angeles New York \n",
"166258 2022-04-01 10:57 19:13 2475.0 Los Angeles New York \n",
"166433 2022-04-01 12:35 20:54 2475.0 Los Angeles New York \n",
"166761 2022-04-01 07:52 16:05 2475.0 Los Angeles New York \n",
"261306 2022-04-01 11:24 20:02 2475.0 Los Angeles New York \n",
"261369 2022-04-01 13:57 22:19 2475.0 Los Angeles New York \n",
"279321 2022-04-01 15:16 23:26 2475.0 Los Angeles New York \n",
"279322 2022-04-01 00:56 09:18 2475.0 Los Angeles New York \n",
"279545 2022-04-01 00:38 08:49 2475.0 Los Angeles New York \n",
"280912 2022-04-01 09:01 17:35 2475.0 Los Angeles New York \n",
"281749 2022-04-01 06:52 15:22 2475.0 Los Angeles New York \n",
"281963 2022-04-01 17:13 01:27 2475.0 Los Angeles New York \n",
"282457 2022-04-01 13:20 21:37 2475.0 Los Angeles New York \n",
"284103 2022-04-01 13:18 21:56 2475.0 Los Angeles New York \n",
"284133 2022-04-01 07:42 15:35 2475.0 Los Angeles New York \n",
"284233 2022-04-01 21:43 05:43 2475.0 Los Angeles New York \n",
"286051 2022-04-01 09:26 17:35 2475.0 Los Angeles New York \n",
"287421 2022-04-01 16:56 01:00 2475.0 Los Angeles New York \n",
"288677 2022-04-01 12:35 NaN 2475.0 Los Angeles New York \n",
"325934 2022-04-01 23:25 07:17 2475.0 Los Angeles New York \n",
"331405 2022-04-01 06:05 14:29 2475.0 Los Angeles New York \n",
"565444 2022-04-01 22:55 07:09 2475.0 Los Angeles New York \n",
"565446 2022-04-01 11:39 19:49 2475.0 Los Angeles New York \n",
"\n",
" Price \n",
"165345 1121 \n",
"165405 572 \n",
"165576 929 \n",
"165636 950 \n",
"165868 965 \n",
"166137 794 \n",
"166258 578 \n",
"166433 984 \n",
"166761 1165 \n",
"261306 1201 \n",
"261369 501 \n",
"279321 1162 \n",
"279322 1169 \n",
"279545 919 \n",
"280912 757 \n",
"281749 992 \n",
"281963 981 \n",
"282457 980 \n",
"284103 899 \n",
"284133 1232 \n",
"284233 749 \n",
"286051 1116 \n",
"287421 1033 \n",
"288677 760 \n",
"325934 588 \n",
"331405 746 \n",
"565444 654 \n",
"565446 616 "
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"x[x['FlightDate']=='2022-04-01']"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "93c2a26f",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"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.9.16"
}
},
"nbformat": 4,
"nbformat_minor": 5
}