title: Keyerror when the value is present
body: <p>I am trying to convert a list into a dictionary while extracting and assigning one element of the list as ley and another as values. The list looks like </p>
  
  <pre><code>todos = [{"general":{"imgUrl":"https://media.licdn.com/dms/image/C5603AQEj3RU2C8iLyA/profile-displayphoto-shrink_800_800/0?e=1568246400&amp;v=beta&amp;t=TBI7KQkcTxdx8Cwbe9PQnP3dkbEc9SI1lLsRGYylS8g","fullName":"A. Valerie Mirko","headline":"General Counsel at North American Securities Administrators Association (NASAA)","company":"North American Securities Administrators Association (NASAA)","school":"The George Washington University Law School","location":"Washington, District Of Columbia","connections":"500+ connections","profileUrl":"https://www.linkedin.com/in/a-valerie-mirko-b856b510/","connectionDegree":"3rd","vmid":"ACoAAAI9K1UBjo3KEOpu_YEN3edB_0UdyvmHOb0","linkedinSalesNavigatorUrl":"https://www.linkedin.com/sales/people/ACoAAAI9K1UBjo3KEOpu_YEN3edB_0UdyvmHOb0,name","description":"","firstName":"A.","lastName":"Valerie Mirko"},"jobs":[{"companyName":"North American Securities Administrators Association (NASAA)","companyUrl":"https://www.linkedin.com/company/75855/","jobTitle":"General Counsel","dateRange":"Oct 2015 – Present","location":"Washington, DC","description":null},{"companyName":"North American Securities Administrators Association (NASAA)","companyUrl":"https://www.linkedin.com/company/75855/","jobTitle":"Legal Department (see below for positions)","dateRange":"Apr 2012 – Oct
  </code></pre>
  
  <p>I am trying to read each element of the list into for loop and reading the list elements into dictionary keys and values.</p>
  
  <pre><code>Ldict={}
  for i in todos:
      Ldict[i["general"]["fullName"]] = i['jobs']
  </code></pre>
  
  <p>I expect the Ldict with fullName as Keys and jobs as values so that i can convert it to a dataframe and then finally export to excel. But the error i am getting is </p>
  
  <pre class="lang-none prettyprint-override"><code>KeyError                                  Traceback (most recent call last)
  &lt;ipython-input-5-95e00e78255f&gt; in &lt;module&gt;
        1 Ldict={}
        2 for i in todos:
  ----&gt; 3     Ldict[i["general"]["fullName"]] = i['jobs']
  
  KeyError: 'general'
  </code></pre>
  
  <p>Although the 'general' is present in the list.In fact </p>
  
  <pre><code>print(todos[0]['general']['fullName'])
  </code></pre>
  
  <p>gives me output as </p>
  
  <pre class="lang-none prettyprint-override"><code>A. Valerie Mirko
  </code></pre>