Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

Getting Invalid Json format #14

Open
utsabc opened this issue Mar 27, 2021 · 1 comment
Open

Getting Invalid Json format #14

utsabc opened this issue Mar 27, 2021 · 1 comment

Comments

@utsabc
Copy link

utsabc commented Mar 27, 2021

Getting JSON format issue because of NaN values in some of the latitudes and longitudes. You could do a check before setting value into the latitudes and longitudes as you already have templated it as "nan"

"latest":306385,"province":"Quebec"},{"coordinates":{"latitude":NaN,"longitude":NaN},"country":"Canada",

Screenshot 2021-03-27 at 10 00 15 PM

@utsabc
Copy link
Author

utsabc commented Mar 27, 2021

Getting JSON format issue because of NaN values in some of the latitudes and longitudes. You could do a check before setting value into the latitudes and longitudes as you already have templated it as "nan"

"latest":306385,"province":"Quebec"},{"coordinates":{"latitude":NaN,"longitude":NaN},"country":"Canada",

Screenshot 2021-03-27 at 10 00 15 PM

Possible solution: refresh.py

 if not math.isnan(row['Lat']):
       tmp_country_position['latitude'] = row['Lat']
 if not math.isnan(row['Long']):
       tmp_country_position['longitude'] = row['Long']

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant