Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turning IP address into location #1

Open
Enturk opened this issue May 12, 2017 · 0 comments
Open

Turning IP address into location #1

Enturk opened this issue May 12, 2017 · 0 comments
Assignees

Comments

@Enturk
Copy link
Collaborator

Enturk commented May 12, 2017

In dropbox we have a csv file sorted by IP with values for countries, regions, and cities, updated to May 2015.

I'm going to have to build on this arff file maker to add the countries, regions, and cities as nominal values to the relative attribute, and then also add them to the appropriate events (lines). Probably something along the lines of:

after loading country & region & city nominal attribute lists into balanced tree at start
for line of input file:
    #sort through other stuff
    for row in csv.reader(dbip-city-2017-05.csv):
        if (row[0] => IPaddress && row[1] <= IPaddress):
            country = row[2]
            region = row[3]
            city = row[4]
            break
    append country & region & city to attribute balanced tree
    append country & region & city to event
[after cycling through all the events' IP addresses] 
rewrite country & region & city nominal attribute lists
@Enturk Enturk self-assigned this May 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant