title: Python Pandas How to Assign JSON Values to a Pandas DF
body: <p>I am requesting data from an API like this:</p>
  <pre><code>output = requests.get(url=url, auth=oauth, headers=headers, data=payload)
  output_data_test = output.json()
  
  output_data_test[&quot;customers&quot;][0][&quot;id&quot;]
  '1'
  </code></pre>
  <p>When I do this, the value does not get assigned:</p>
  <pre><code>combined_output_temp_df = output_data_test[&quot;customers&quot;][0][&quot;id&quot;]
  
  combined_output_temp_df
  Empty DataFrame
  </code></pre>
  <p>What am I doing wrong?</p>
  <p>Here is how I created my dataframe:</p>
  <pre><code>combined_output_temp_df = pd.DataFrame(
      columns = [
          &quot;id&quot;,
          &quot;first_name&quot;,
          &quot;last_name&quot;,
          &quot;middle_initial&quot;,
          &quot;email&quot;,
          ### - Preferences
          &quot;preference_email_invoices&quot;,
          &quot;preference_print_invoices&quot;,
          &quot;preference_exclude_from_insurance_auto_enroll_on&quot;,
          ###
          &quot;username&quot;,
          &quot;created_at&quot;,,
          &quot;blocked_payments&quot;,
          ### - Phone Numbers
          &quot;phone_number_id&quot;,
          &quot;phone_number_primary&quot;,
          ### - Mailing Address
          &quot;mailing_address_id&quot;,
          &quot;mailing_address_address1&quot;,
          &quot;mailing_address_address2&quot;,
          &quot;mailing_address_city&quot;,
          &quot;mailing_address_state&quot;,
          &quot;mailing_address_latitude&quot;,
          ### - Addresses
          &quot;address_id&quot;,
          &quot;address_address1&quot;, 
          &quot;address_address2&quot;,
          &quot;address_city&quot;,
          &quot;address_state&quot;,
          &quot;address_invalid_data&quot;,
          &quot;address_label&quot;
          ###
          ]
      )
  </code></pre>
  <p>Here is roughly what the JSON looks like:</p>
  <pre><code>{
      'customers': [
          {
              'id': '1', 
              'first_name': 'James', 
              'last_name': 'Test', 
              'middle_initial': '', 
              'email': 'jamesemail@test.com', 
              'preferences': {
                  'email_invoices': False, 
                  'print_invoices': False, 
                  'exclude_from_insurance_auto_enroll_on': None
                  }, 
                  
                  'username': jamestesting, 
                  'created_at': '2021-03-11T13:00:00.404-05:00', 
                  'blocked_payments': False, 
                  'phone_numbers': [
                      {
                          'id': '234234asdf', 
                          'primary': True
                      }, 
                      {
                          'id': '8438c19a', 
                          'primary': False
                      }
                  ], 'mailing_address': {
                      'id': '431fe0b2', 
                      'address1': '15777 Fake Blvd', 
                      'address2': 'Lot 196', 
                      'city': 'Testing', 
                      'state': 'TX', 
                      'latitude': None
                  }, 'addresses': [
                      {
                          'id': '431fe0b2', 
                          'address1': '157 whatever', 
                          'address2': 'Lot 196', 
                          'city': 'Sacramento', 
                          'state': 'NY', 
                          'invalid_data': False, 
                          'label': 'Home'
                      }
                  ]
            }
     ]
  </code></pre>
  <p>}</p>
  <p>Some customers have multiple phone numbers, some have 0 phone numbers. Same with mailing address and other attributes not found here. When I tried to use explode, it gave me an error message</p>