Beispiel #1
0
'''
Created on Dec 1, 2012

@author: cosmin
'''

from foa import Foa

# Load data
foa = Foa()
users = foa.load_users_from_csv("../data/users.csv")
projects = foa.loadProjectDetailsFromCSV("../data/projects_details.csv")

# Processing the projects
print "Building nationalities interactions map..."
countries = {}
count = 0
no_accepted = 0
failed = 0
for p in projects.values():
    # Printing
    count += 1
    if count % 2500 == 0:
        print "Processed", count, "projects out of", len(projects.values())

    # Get the countries of accepted bidders for this buyer_country
    accepted = countries.get(p.buyer_country)
    if accepted == None:
        accepted = [0, {}]
        countries[p.buyer_country] = accepted
"""
Created on Dec 1, 2012

@author: cosmin
"""

from foa import Foa

# Load data
foa = Foa()
users = foa.load_users_from_csv("../data/users.csv")
projects = foa.loadProjectDetailsFromCSV("../data/projects_details.csv")

# Processing the projects
print "Building nationalities interactions map..."
countries = {}
count = 0
no_accepted = 0
failed = 0
for p in projects.values():
    # Printing
    count += 1
    if count % 2500 == 0:
        print "Processed", count, "projects out of", len(projects.values())

    # Get the countries of accepted bidders for this buyer_country
    accepted = countries.get(p.buyer_country)
    if accepted == None:
        accepted = [0, {}]
        countries[p.buyer_country] = accepted