Delete tools/flights/test.py
Browse files- tools/flights/test.py +0 -35
tools/flights/test.py
DELETED
|
@@ -1,35 +0,0 @@
|
|
| 1 |
-
# import os
|
| 2 |
-
# from tools.flights.apis import Flights
|
| 3 |
-
# import re
|
| 4 |
-
# import sys
|
| 5 |
-
# import os
|
| 6 |
-
|
| 7 |
-
# flight = Flights('/home/xj/toolAugEnv/code/toolConstraint/database/flights/clean_Flights_2022.csv')
|
| 8 |
-
# data = flight.run('Austin', 'Seattle', '2022-03-01')
|
| 9 |
-
# # print(len(data))
|
| 10 |
-
# print(data)
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
from tools.flights.apis import Flights
|
| 14 |
-
import pandas as pd
|
| 15 |
-
import sys
|
| 16 |
-
import os
|
| 17 |
-
# results = self.data[self.data["OriginCityName"] == origin]
|
| 18 |
-
# results = results[results["DestCityName"] == destination]
|
| 19 |
-
sys.path.append(os.path.abspath(os.path.join(os.getcwd(), "..")))
|
| 20 |
-
os.chdir(os.path.dirname(os.path.abspath(__file__)))
|
| 21 |
-
unique_cities = list(Flights(path="..//home/user/app/database/flights/clean_Flights_2022.csv").data['OriginCityName'].unique()) + list(Flights(path="..//home/user/app/database/flights/clean_Flights_2022.csv").data['DestCityName'].unique())
|
| 22 |
-
df = Flights(path="..//home/user/app/database/flights/clean_Flights_2022.csv").data
|
| 23 |
-
|
| 24 |
-
print(len(df))
|
| 25 |
-
|
| 26 |
-
citySet = open('..//home/user/app/database/background/citySet.txt','r').read().split('\n')
|
| 27 |
-
cnt = 0
|
| 28 |
-
|
| 29 |
-
for city in unique_cities:
|
| 30 |
-
if city not in citySet:
|
| 31 |
-
df = df[(df['OriginCityName'] != city) & (df['DestCityName'] != city)]
|
| 32 |
-
|
| 33 |
-
print(len(df))
|
| 34 |
-
|
| 35 |
-
df.to_csv('..//home/user/app/database/flights/clean_Flights_2022.csv', index=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|