File size: 707 Bytes
9be4956
 
 
 
 
 
6159f52
 
9be4956
6159f52
9be4956
 
 
 
 
 
6159f52
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="..//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)