Last active
November 23, 2017 17:21
-
-
Save lucaspg96/26afa9ac3d59322e604696514c6e93ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pymongo import MongoClient as mc | |
collection = mc().datavis.menus | |
found = 0 | |
not_found = 0 | |
with open("locations-2017-11-16 12:42:08.068035.txt") as f: | |
for line in f: | |
place,coords= line.split(" -> ") | |
if not collection.find_one({"place":place}): | |
place = place.rstrip() | |
if not collection.find_one({"place":place}): | |
place = place.rstrip() | |
print("{} -> {}".format(place,len(place))) | |
not_found+=1 | |
else: | |
found+=1 | |
else: | |
found+=1 | |
print("\n\n{} locations found. {} not found".format(found,not_found)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment