Skip to content

ipinfo return an error (IndexError: tuple index out of range) when details of specific IP address is not available.  #10

@dc-aichara

Description

@dc-aichara

I am getting IndexError for following code

import ipinfo
access_token = '************'
handler = ipinfo.getHandler(access_token)
ip_country = lambda x:handler.getDetails(x).country


df1['country'] = df1["IP_address"].apply(ip_country)

There are few IP address for which it gives IndexError. For Example : 192.168.73.231, 10.62.100.139
If we try handler.getDetails('10.62.100.139').country, it will retrun IndexError:tuple index out of range.

Can you edit ipinfo package that it return NAN in such cases?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions