title: Why are there missing records when I convert from pandas df to dictionary?
body: <p>I am trying to convert a DBF of about 3233 records created from a shapefile of US counties to a dataframe; then I want to take two of the columns from that dataframe and <strong>convert to a dictionary where <code>column1</code> is the key and <code>column2</code> is the value</strong>. However, the resulting dictionary doesn't have the same number of records as my dataframe.</p>
  <ul>
  <li>I use arcpy to call in the shapefile for all US Counties. When I use arcpy.GetCount_management(county_shapefile), this returns a feature count of 3233 records.</li>
  <li>In order to convert to a dataframe, I converted to a dbf first with arcpy.TableToTableconversion(), this returns a dbf with 3233 records.</li>
  <li>After converting to a df using Dbf5 from simpledbf, I get a df with 3233 records.</li>
  <li><strong>I then convert the first two columns to a dictionary which returns 56 records</strong>. Can anyone tell me what's going on here? (I recently switched to Python 3 from Python 2, could that be part of the issue?)</li>
  </ul>
  <p>Code:</p>
  <pre><code>county_shapefile = &quot;U:/Shapefiles/tl_2018_us_county/tl_2018_us_county.shp&quot;
  dbf = arcpy.TableToTable_conversion(county_shapefile,&quot;U:/&quot;,&quot;county_data.dbf&quot;)
  
  from simpledbf import Dbf5
  dbfile = Dbf5(str(dbf))
  df = dbfile.to_dataframe()
  
  df_dict = {row[0]:row[1] for row in df.values}
  </code></pre>
  <p>I have also tried doing this with the <code>.to_dict()</code> function, but I'm not getting the desired dictionary structure {column1:column2,column1:column2...}</p>
  <pre><code>from simpledbf import Dbf5
  dbfile=Dbf5(str(dbf))
  df=dbfile.to_dataframe()
  subset=df[[&quot;STATEFP&quot;,&quot;COUNTYFP&quot;]]
  subset=subset.set_index(&quot;COUNTYFP&quot;)
  dict=subset.to_dict()
  </code></pre>
  <p>In the end, I'm hoping to create a dictionary where the key is the County FIPS code (COUNTYFP) and the value is the State FIPS code (STATEFP). I do not want to have any nested dictionaries, just a simple dictionary with the format...</p>
  <pre><code>dict={
     COUNTYFP1:STATEFP1,
     COUNTYFP2:STATEFP2,
     COUNTYFP3:STATEFP3,
     ....
  }
  </code></pre>