gojiplus / get-weather-data

Get weather data for a list of zip codes for a range of dates
http://get-weather-data.readthedocs.io/en/latest/
MIT License
38 stars 18 forks source link

Unicode error 'python zip2ws.py -i' #10

Open Wake-Up-Donnie opened 4 years ago

Wake-Up-Donnie commented 4 years ago

Running 'python zip2ws.py -i' gives me these two warnings, I believe it is because of a unicode error in the address. Did anyone else get this?

Downloading 'http://federalgovernmentzipcodes.us/free-zipcode-database-Primary.csv'... Downloading 'http://www1.ncdc.noaa.gov/pub/data/ghcn/daily/ghcnd-stations.txt'... Downloading 'ftp://ftp.ncdc.noaa.gov/pub/data/noaa/isd-history.csv'... WARNING: Table stations already created WARNING: Cannot insert row ==> ('UTQIA\xc4\xa0VIK FORMERLY BARROW 4 ENE', -0.156611, 0.0046, 2002080.8)

gg314 commented 4 years ago

In Python 3, I was able to get things running by modifying zip2ws.py:

  1. In class Logger(), added def flush(self): pass.
  2. Removed decode("utf-8")
  3. reader.next() became next(reader) and files are now opened as r instead of rb

I get one warning while computing closest stations with -c but it does not seem to matter: Table closest already created.