from tools.attractions.apis import Attractions | |
import pandas as pd | |
import sys | |
import os | |
sys.path.append(os.path.abspath(os.path.join(os.getcwd(), ".."))) | |
os.chdir(os.path.dirname(os.path.abspath(__file__))) | |
unique_cities = Attractions(path="..//home/user/app/database/attractions/attractions.csv").data['City'].unique() | |
df = Attractions(path="..//home/user/app/database/attractions/attractions.csv").data | |
print(len(df)) | |
citySet = open('..//home/user/app/database/background/citySet.txt','r').read().split('\n') | |
cnt = 0 | |
for city in unique_cities: | |
if city not in citySet: | |
df = df[df['City'] != city] | |
print(len(df)) | |
df.to_csv('..//home/user/app/database/attractions/attractions2.csv', index=False) |