title: Folium Heatmaps
body: <p><strong>Heatmaps in Folium</strong></p>
  
  <p>I have a dataframe with house transactions data (metadata about the house, location and price).</p>
  
  <p>I would like to make a heatmap in folium representing the price, and not the frequency as per default. So, areas with high transaction prices gets more colored and vice versa.</p>
  
  <p>Do anybody know? My best guess would be to represent the price as as number of rows, e.g. if one row was one price unit and the house was sold for 5 units, then I would need to duplicate the row 5 times. But this is simply not compute friendly enough (if at all possible). </p>
  
  <p>Thanks!</p>
  
  <p>Here is a representation of my data:</p>
  
  <pre><code>data = pd.DataFrame({"house_id" : [1, 2, 3, 4],
                       "latitude": [55.83, 55.79, 55.86, 55.85],
                       "longitude": [12.05, 12.10, 12.07, 12.09],
                       "price": [2000, 2100, 1500, 4500]})
  </code></pre>
  
  <p>And here comes the code I use to generate the heatmap with Folium, which by now makes the "heat" in terms of how frequent the location apperars in terms of #rows..</p>
  
  <pre><code>from folium import plugins
  from folium.plugins import HeatMap
  
  heat_data = [[row['latitude'],row['longitude']] for index, row in data.iterrows()]
  map = folium.Map(location=[55.838913, 12.055415], zoom_start = 13)
  
  # Plot it on the map
  HeatMap(heat_data).add_to(map)
  
  # Display the map
  map
  </code></pre>