learn-co-curriculum / py-lists-with-maps

Other
2 stars 4 forks source link

Import of folium returns error #16

Closed butlerbt closed 5 years ago

butlerbt commented 5 years ago

TypeErrorTraceback (most recent call last)

in () 1 import folium ----> 2 buenos_map = folium.Map([ba_latitude, ba_longitude]) 3 buenos_map /opt/conda/envs/learn-env/lib/python3.6/site-packages/folium/folium.py in __init__(self, location, width, height, left, top, position, tiles, API_key, max_zoom, min_zoom, max_native_zoom, zoom_start, world_copy_jump, no_wrap, attr, min_lat, max_lat, min_lon, max_lon, max_bounds, detect_retina, crs, control_scale, prefer_canvas, no_touch, disable_3d, subdomains, png_enabled, zoom_control) 237 self.zoom_start = 1 238 else: --> 239 self.location = _validate_location(location) 240 self.zoom_start = zoom_start 241 /opt/conda/envs/learn-env/lib/python3.6/site-packages/folium/utilities.py in _validate_location(location) 41 raise ValueError('Expected two values for location [lat, lon], ' 42 'got {}'.format(len(location))) ---> 43 if _isnan(location): 44 raise ValueError('Location values cannot contain NaNs, ' 45 'got {!r}'.format(location)) /opt/conda/envs/learn-env/lib/python3.6/site-packages/folium/utilities.py in _isnan(values) 77 def _isnan(values): 78 """Check if there are NaNs values in the iterable.""" ---> 79 return any(math.isnan(value) for value in _flatten(values)) 80 81 /opt/conda/envs/learn-env/lib/python3.6/site-packages/folium/utilities.py in (.0) 77 def _isnan(values): 78 """Check if there are NaNs values in the iterable.""" ---> 79 return any(math.isnan(value) for value in _flatten(values)) 80 81 TypeError: must be real number, not NoneType
mas16 commented 5 years ago

Hi butlerbt, thanks for the note! This looks like an error with how ba_latitude and ba_longitude are assigned rather than with import of folium.