title: Python - Folium Choropleth Map - colors incorrect
body: <p>My problem is that suburbs are not displaying the correct color on the Folium map. For example, Dandenong and Frankston should be shaded with the darkest color as they have the highest count in the dataframe, but they are shaded with a lighter color.</p>
  
  <p>The dataframe is missing some suburbs. Those suburbs are being colored with the darkest color.</p>
  
  <p>Another problem is the csv has all suburbs in UPPERCASE but the geojson has a mixture of cases such as "Frankston", "St Kilda", or "McKinnon". It would be helpful if the choropleth code didn't care about case. I can change the text in the dataframe to make "FRANKSTON", "Frankston", and "ST KILDA", "St Kilda", but "MCKINNON" to "McKinnon" is proving a bit trickier.</p>
  
  <p>Create Dataframe</p>
  
  <pre><code>import csv 
  import pandas as pd
  csv_path='Data_tables_Criminal_Incidents_Visualisation_year_ending_June_2018.csv'
  df=pd.read_csv(csv_path)
  
  with open(csv_path, 'r') as csvfile: 
      # creating a csv reader object 
      csvreader = csv.reader(csvfile) 
      # create a list of headings from the first row of the csv file
      headings = next(csvreader)
  
  # create a dictionary, where keys are Suburb/Town Name and values are number of occurences
  # index 2 of the headings list are the suburbs
  neighborhood_dict = df[headings[2]].value_counts().to_dict()
  
  # make first letter uppercase eg St Kilda
  neighborhood_dict = dict((k.title(), v) for k, v in neighborhood_dict.items())
  
  
  # make neighborhood_list from neighborhood_dict
  neighborhood_list=[]
  for key, value in neighborhood_dict.items():
      temp = [key,value]
      neighborhood_list.append(temp)
  
  # make dataframe from neighborhood_list
  df = pd.DataFrame(neighborhood_list, columns=['Suburb','Count'])
  
  print(df.to_string()) 
  </code></pre>
  
  <p>Create Map</p>
  
  <pre><code>import folium
  
  world_map = folium.Map(
          location=[-38.292102, 144.727880],
          zoom_start=6,
          tiles='openstreetmap'
          )
  
  world_map.choropleth(
          geo_data='vic.geojson',
          data=df,
          columns=['Suburb','Count'],
          key_on='feature.properties.Suburb_Name',
          fill_color='YlOrRd',
          fill_opacity=0.7,
          line_opacity=0.2,
          legend_name='Crime Rate in Victoria'
          )
  
  world_map.save('index.html')
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/4MGTo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4MGTo.png" alt="Dataframe Image"></a></p>
  
  <p><a href="https://i.stack.imgur.com/gKmbd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gKmbd.png" alt="Legend"></a></p>
  
  <p><a href="https://i.stack.imgur.com/QmBGM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QmBGM.png" alt="Map Image"></a></p>