File size: 659 Bytes
9be4956
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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="../../database/attractions/attractions.csv").data['City'].unique()
df = Attractions(path="../../database/attractions/attractions.csv").data
print(len(df))
citySet = open('../../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('../../database/attractions/attractions2.csv', index=False)