title: TypeError: 'NoneType' object is not subscriptable folium choropleth plots
body: <p>Could anyone explain where I'm going wrong here please?  I'm very new to coding.  I'm trying to do a choropleth plot using folium.  I have  csv file with  5 columns of data: &quot;contact_name&quot;, &quot;city&quot;, &quot;country&quot;, &quot;alpha_2_code&quot; and &quot;Count&quot; which I'm importing for plotting using the code below.  I'm requesting a json file with country data with this format (this is the [0] index): {'id': 4, 'name': 'Afghanistan', 'alpha2': 'af', 'alpha3': 'afg'}.</p>
  <p>I've tried searching stack overflow for solutions as well as youtube videos and an udemy course I'm working through but I don't <em>think</em> I've found anything to fit the bill.</p>
  <p>I'm expecting the code below to return a choropleth plot of shaded countries.  My counts column just has a value of 1 for each entry but I want the plot to be darker if, for example, there are multiple country entries but I get this error:</p>
  <pre><code>TypeError                                 Traceback (most recent call last)
  ~\AppData\Local\Temp/ipykernel_15828/2184368914.py in &lt;module&gt;
  ----&gt; 1 folium.Choropleth(geo_data=geojson,data=map_data,column = [&quot;alpha_2_code&quot;,&quot;count&quot;],key_on=&quot;alpha2&quot;,fill_color=&quot;BuPu&quot;,
        2     fill_opacity=0.7,line_opacity=0.2).add_to(M)
  
  mypath\lib\site-packages\folium\features.py in __init__(self, geo_data, data, columns, key_on, bins, fill_color, nan_fill_color, fill_opacity, nan_fill_opacity, line_color, line_weight, line_opacity, name, legend_name, overlay, control, show, topojson, smooth_factor, highlight, **kwargs)
     1198         if hasattr(data, 'set_index'):
     1199             # This is a pd.DataFrame
  -&gt; 1200             color_data = data.set_index(columns[0])[columns[1]].to_dict()
     1201         elif hasattr(data, 'to_dict'):
     1202             # This is a pd.Series
  
  TypeError: 'NoneType' object is not subscriptable
  
  
  import pandas as pd
  import requests
  import folium
  df = pd.read_csv(r&quot;file with some data and a column of alpha_2 country codes.csv&quot;)
  map_data = df[[&quot;Contact_name&quot;,&quot;City&quot;,&quot;Country&quot;,&quot;alpha_2_code&quot;,&quot;count&quot;]]
  geojson_url = (&quot;https://raw.githubusercontent.com/stefangabos/world_countries/master/data/en/world.json&quot;)
  response = requests.get(geojson_url)
  geojson = response.json()
  M = folium.Map(location = [20,10], zoom_start = 2)
  folium.Choropleth(geo_data=geojson,data=map_data,column = [&quot;alpha_2_code&quot;,&quot;count&quot;],key_on=&quot;alpha2&quot;,fill_color=&quot;BuPu&quot;,fill_opacity=0.7,line_opacity=0.2).add_to(M)
  </code></pre>