Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import psycopg2
- con = psycopg2.connect("dbname='admininfo' user='postgres' password='pT_653#gL@!1' host='54.202.248.116'")
- cur = con.cursor()
- cur.execute("SELECT rating, _id from dingi_pois WHERE source = 'GooglePoi' AND (type LIKE 'restaurant%' OR type LIKE 'mosque%'\
- OR type LIKE 'school%' OR type LIKE 'point_of_interest%' OR type LIKE 'store%' OR type LIKE 'clothing_store%'\
- OR type LIKE 'shopping_mall%' OR type LIKE 'pharmacy%' OR type LIKE 'home_goods_store%' OR type LIKE 'electronics_store%'\
- OR type LIKE 'premise%' OR type LIKE 'food%' OR type LIKE 'hindu_temple%' OR type LIKE 'cafe%'\
- OR type LIKE 'furniture_store%' OR type LIKE 'grocery_or_supermarket%' OR type LIKE 'lodging%'\
- OR type LIKE 'hair_care%' OR type LIKE 'hardware_store%' OR type LIKE 'general_contractor%' OR type LIKE 'supermarket%'\
- OR type LIKE 'jewelry_store%' OR type LIKE 'beauty_salon%' OR type LIKE 'shoe_store%' OR type LIKE 'place_of_worship%' OR type LIKE 'bakery%'\
- OR type LIKE 'doctor%' OR type LIKE 'dentist%' OR type LIKE 'bicycle_store%' OR type LIKE 'electrician%' OR type LIKE 'physiotherapist%');")
- rows = cur.fetchall()
- file = open('typeReduction.txt', 'w')
- for row in rows:
- if row[0] is None or row[0] < 3:
- file.write(str(row[1]) + '\n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement