ipinfo return an error (IndexError: tuple index out of range) when details of specific IP address is not available.
See original GitHub issueI 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?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Python IndexError: tuple index out of range Solution
The IndexError: tuple index out of range error occurs when you try to access an item in a tuple that does not exist....
Read more >IndexError: tuple index out of range ----- Python - Stack Overflow
I'm running a simple python program that will display the data from mySQL database in a tkinter form... from Tkinter import * import...
Read more >IndexError: tuple index out of range #167 - GitHub
This probably happens when missing data is coded '.' instead of './.' (see #20 (comment)). You can recode the dataset, e.g., using plink...
Read more >Why is this code throwing a 'tuple index out of range' error?
I'm still not entirely sure why the node connections are listed in a way that requires this, but the solution turns out to...
Read more >IndexError: tuple index out of range in Python | bobbyhadz
The Python "IndexError: tuple index out of range" occurs when we try to access an index that doesn't exist in a tuple. Indexes...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@dc-aichara It’s released!
@dc-aichara Yep will merge and release it ASAP.