symerio / pgeocode

Postal code geocoding and distance calculation
https://pgeocode.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
238 stars 58 forks source link

pandas 1.0.1 _infer_compression error #28

Closed cnpryer closed 4 years ago

cnpryer commented 4 years ago

requirements.txt

numpy==1.18.1
pandas==1.0.1
pgeocode==0.1.2

test.py

import pgeocode
nomi = pgeocode.Nominatim('fr')

error:

>\venv\lib\site-packages\pgeocode.py (line 69, in _get_data)
>from pandas.io.common import get_filepath_or_buffer, _infer_compression
rth commented 4 years ago

Could you please post the full error traceback?

cnpryer commented 4 years ago

upgraded to 0.2.1

rth commented 4 years ago

upgraded to 0.2.1

If it failed with 0.2.0 it's likely it will fail with 0.2.1 as well.

cnpryer commented 4 years ago

Could you please post the full error traceback?

Another error started this. I was getting AttributeError: Can only use .str accessor with string values! at line 130, in _normalize_postal_code (in pgeocode.py).

The line:

codes['postal_code'] = codes.postal_code.str.upper()

After updating pgeocode #28 resolved but I'll probably start a new issue for the AttributeError if I cant figure it out in a bit.

update: was testing out a sample of zip codes from another data set and that's when I saw the AttributeError. It looks like I was passing pgeocode.query_postal_code a list of integers rather than a list of strings; AttributeError is resolved after making the change to strings.