SHARE
TWEET

Untitled

a guest Jun 17th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def generateBaseMap(default_location=[40.704652, -73.923688], default_zoom_start=11):
  2.     base_map = folium.Map(location=default_location, control_scale=True, zoom_start=default_zoom_start)
  3.     return base_map
  4.  
  5. base_map = generateBaseMap()
  6. hm = HeatMap(list(zip(df_2y_cons_LatLo.Latitude.values,df_2y_cons_LatLo.Longitude.values,df_2y_cons_LatLo.Descriptor.values)))
  7. base_map.add_child(hm)
  8.      
  9. TypeError                                 Traceback (most recent call last)
  10. ~Anaconda3libsite-packagesIPythoncoreformatters.py in __call__(self, obj)
  11.     343             method = get_real_method(obj, self.print_method)
  12.     344             if method is not None:
  13. --> 345                 return method()
  14.     346             return None
  15.     347         else:
  16.  
  17. ~Anaconda3libsite-packagesfoliumfolium.py in _repr_html_(self, **kwargs)
  18.     291             self._parent = None
  19.     292         else:
  20. --> 293             out = self._parent._repr_html_(**kwargs)
  21.     294         return out
  22.     295
  23.  
  24. ~Anaconda3libsite-packagesbrancaelement.py in _repr_html_(self, **kwargs)
  25.     326
  26.     327         """
  27. --> 328         html = self.render(**kwargs)
  28.     329         html = "data:text/html;charset=utf-8;base64," + base64.b64encode(html.encode('utf8')).decode('utf8')  # noqa
  29.     330
  30.  
  31. ~Anaconda3libsite-packagesbrancaelement.py in render(self, **kwargs)
  32.     319         """Renders the HTML representation of the element."""
  33.     320         for name, child in self._children.items():
  34. --> 321             child.render(**kwargs)
  35.     322         return self._template.render(this=self, kwargs=kwargs)
  36.     323
  37.  
  38. ~Anaconda3libsite-packagesfoliumfolium.py in render(self, **kwargs)
  39.     368             '</style>'), name='map_style')
  40.     369
  41. --> 370         super(Map, self).render(**kwargs)
  42.     371
  43.     372     def fit_bounds(self, bounds, padding_top_left=None,
  44.  
  45. ~Anaconda3libsite-packagesbrancaelement.py in render(self, **kwargs)
  46.     631
  47.     632         for name, element in self._children.items():
  48. --> 633             element.render(**kwargs)
  49.  
  50. ~Anaconda3libsite-packagesfoliumpluginsheat_map.py in render(self, **kwargs)
  51.      79
  52.      80     def render(self, **kwargs):
  53. ---> 81         super(HeatMap, self).render(**kwargs)
  54.      82
  55.      83         figure = self.get_root()
  56.  
  57. ~Anaconda3libsite-packagesbrancaelement.py in render(self, **kwargs)
  58.     627         script = self._template.module.__dict__.get('script', None)
  59.     628         if script is not None:
  60. --> 629             figure.script.add_child(Element(script(self, kwargs)),
  61.     630                                     name=self.get_name())
  62.     631
  63.  
  64. ~Anaconda3libsite-packagesjinja2runtime.py in __call__(self, *args, **kwargs)
  65.     573                             (self.name, len(self.arguments)))
  66.     574
  67. --> 575         return self._invoke(arguments, autoescape)
  68.     576
  69.     577     def _invoke(self, arguments, autoescape):
  70.  
  71. ~Anaconda3libsite-packagesjinja2asyncsupport.py in _invoke(self, arguments, autoescape)
  72.     108     def _invoke(self, arguments, autoescape):
  73.     109         if not self._environment.is_async:
  74. --> 110             return original_invoke(self, arguments, autoescape)
  75.     111         return async_invoke(self, arguments, autoescape)
  76.     112     return update_wrapper(_invoke, original_invoke)
  77.  
  78. ~Anaconda3libsite-packagesjinja2runtime.py in _invoke(self, arguments, autoescape)
  79.     577     def _invoke(self, arguments, autoescape):
  80.     578         """This method is being swapped out by the async implementation."""
  81. --> 579         rv = self._func(*arguments)
  82.     580         if autoescape:
  83.     581             rv = Markup(rv)
  84.  
  85. <template> in macro(l_1_this, l_1_kwargs)
  86.  
  87. ~Anaconda3libsite-packagesjinja2filters.py in do_tojson(eval_ctx, value, indent)
  88.    1076         options = dict(options)
  89.    1077         options['indent'] = indent
  90. -> 1078     return htmlsafe_json_dumps(value, dumper=dumper, **options)
  91.    1079
  92.    1080
  93.  
  94. ~Anaconda3libsite-packagesjinja2utils.py in htmlsafe_json_dumps(obj, dumper, **kwargs)
  95.     563     if dumper is None:
  96.     564         dumper = json.dumps
  97. --> 565     rv = dumper(obj, **kwargs)
  98.     566         .replace(u'<', u'\u003c')
  99.     567         .replace(u'>', u'\u003e')
  100.  
  101. ~Anaconda3libjson__init__.py in dumps(obj, skipkeys, ensure_ascii, check_circular, allow_nan, cls, indent, separators, default, sort_keys, **kw)
  102.     236         check_circular=check_circular, allow_nan=allow_nan, indent=indent,
  103.     237         separators=separators, default=default, sort_keys=sort_keys,
  104. --> 238         **kw).encode(obj)
  105.     239
  106.     240
  107.  
  108. ~Anaconda3libjsonencoder.py in encode(self, o)
  109.     197         # exceptions aren't as detailed.  The list call should be roughly
  110.     198         # equivalent to the PySequence_Fast that ''.join() would do.
  111. --> 199         chunks = self.iterencode(o, _one_shot=True)
  112.     200         if not isinstance(chunks, (list, tuple)):
  113.     201             chunks = list(chunks)
  114.  
  115. ~Anaconda3libjsonencoder.py in iterencode(self, o, _one_shot)
  116.     255                 self.key_separator, self.item_separator, self.sort_keys,
  117.     256                 self.skipkeys, _one_shot)
  118. --> 257         return _iterencode(o, 0)
  119.     258
  120.     259 def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
  121.  
  122. ~Anaconda3libjsonencoder.py in default(self, o)
  123.     178         """
  124.     179         raise TypeError("Object of type '%s' is not JSON serializable" %
  125. --> 180                         o.__class__.__name__)
  126.     181
  127.     182     def encode(self, o):
  128.  
  129. TypeError: Object of type 'int64' is not JSON serializable
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top