Converting IP2LocationRecord to Pandas.DataFrame

78 views Asked by At

Is there a way to use IP2Location database.get_all() and convert the results into a Pandas DataFrame? I am really lost and confused as to how to do it.

I have gotten an error AttributeError: 'IP2LocationRecord' object has no attribute 'values'.

The values I obtained

{'ip': '104.145.231.146', 'country_short': 'US', 'country_long': 'United States of America', 'region': 'New York',
 'city': 'Buffalo', 'latitude': 42.886452, 'longitude': -78.878372, 'zipcode': '14201', 'timezone': '-05:00'}

Expected outcome

     ip                 country_short    country_long        ....       zipcode      timezone
0    104.145.231.146    US               United States of America       14201        -05:00
0

There are 0 answers