title: Read JSON file and Convert to Panda DataFrame
body: <p>I have a text file that contains JSON format data like this.</p>
  <pre><code>{&quot;accountNumber&quot;: &quot;737265056&quot;, &quot;customerId&quot;: &quot;737265056&quot;, &quot;creditLimit&quot;: 5000.0, &quot;availableMoney&quot;: 5000.0, &quot;transactionDateTime&quot;: &quot;2016-08-13T14:27:32&quot;, &quot;transactionAmount&quot;: 98.55, &quot;merchantName&quot;: &quot;Uber&quot;, &quot;acqCountry&quot;: &quot;US&quot;, &quot;merchantCountryCode&quot;: &quot;US&quot;, &quot;posEntryMode&quot;: &quot;02&quot;, &quot;posConditionCode&quot;: &quot;01&quot;, &quot;merchantCategoryCode&quot;: &quot;rideshare&quot;, &quot;currentExpDate&quot;: &quot;06/2023&quot;, &quot;accountOpenDate&quot;: &quot;2015-03-14&quot;, &quot;dateOfLastAddressChange&quot;: &quot;2015-03-14&quot;, &quot;cardCVV&quot;: &quot;414&quot;, &quot;enteredCVV&quot;: &quot;414&quot;, &quot;cardLast4Digits&quot;: &quot;1803&quot;, &quot;transactionType&quot;: &quot;PURCHASE&quot;, &quot;echoBuffer&quot;: &quot;&quot;, &quot;currentBalance&quot;: 0.0, &quot;merchantCity&quot;: &quot;&quot;, &quot;merchantState&quot;: &quot;&quot;, &quot;merchantZip&quot;: &quot;&quot;, &quot;cardPresent&quot;: false, &quot;posOnPremises&quot;: &quot;&quot;, &quot;recurringAuthInd&quot;: &quot;&quot;, &quot;expirationDateKeyInMatch&quot;: false, &quot;isFraud&quot;: false}
  {&quot;accountNumber&quot;: &quot;737265056&quot;, &quot;customerId&quot;: &quot;737265056&quot;, &quot;creditLimit&quot;: 5000.0, &quot;availableMoney&quot;: 5000.0, &quot;transactionDateTime&quot;: &quot;2016-10-11T05:05:54&quot;, &quot;transactionAmount&quot;: 74.51, &quot;merchantName&quot;: &quot;AMC #191138&quot;, &quot;acqCountry&quot;: &quot;US&quot;, &quot;merchantCountryCode&quot;: &quot;US&quot;, &quot;posEntryMode&quot;: &quot;09&quot;, &quot;posConditionCode&quot;: &quot;01&quot;, &quot;merchantCategoryCode&quot;: &quot;entertainment&quot;, &quot;cardPresent&quot;: true, &quot;currentExpDate&quot;: &quot;02/2024&quot;, &quot;accountOpenDate&quot;: &quot;2015-03-14&quot;, &quot;dateOfLastAddressChange&quot;: &quot;2015-03-14&quot;, &quot;cardCVV&quot;: &quot;486&quot;, &quot;enteredCVV&quot;: &quot;486&quot;, &quot;cardLast4Digits&quot;: &quot;767&quot;, &quot;transactionType&quot;: &quot;PURCHASE&quot;, &quot;echoBuffer&quot;: &quot;&quot;, &quot;currentBalance&quot;: 0.0, &quot;merchantCity&quot;: &quot;&quot;, &quot;merchantState&quot;: &quot;&quot;, &quot;merchantZip&quot;: &quot;&quot;, &quot;posOnPremises&quot;: &quot;&quot;, &quot;recurringAuthInd&quot;: &quot;&quot;, &quot;expirationDateKeyInMatch&quot;: false, &quot;isFraud&quot;: false}
  {&quot;accountNumber&quot;: &quot;737265056&quot;, &quot;customerId&quot;: &quot;737265056&quot;, &quot;creditLimit&quot;: 5000.0, &quot;availableMoney&quot;: 5000.0, &quot;transactionDateTime&quot;: &quot;2016-11-08T09:18:39&quot;, &quot;transactionAmount&quot;: 7.47, &quot;merchantName&quot;: &quot;Play Store&quot;, &quot;acqCountry&quot;: &quot;US&quot;, &quot;merchantCountryCode&quot;: &quot;US&quot;, &quot;posEntryMode&quot;: &quot;09&quot;, &quot;posConditionCode&quot;: &quot;01&quot;, &quot;merchantCategoryCode&quot;: &quot;mobileapps&quot;, &quot;currentExpDate&quot;: &quot;08/2025&quot;, &quot;accountOpenDate&quot;: &quot;2015-03-14&quot;, &quot;dateOfLastAddressChange&quot;: &quot;2015-03-14&quot;, &quot;cardCVV&quot;: &quot;486&quot;, &quot;enteredCVV&quot;: &quot;486&quot;, &quot;cardLast4Digits&quot;: &quot;767&quot;, &quot;transactionType&quot;: &quot;PURCHASE&quot;, &quot;echoBuffer&quot;: &quot;&quot;, &quot;currentBalance&quot;: 0.0, &quot;merchantCity&quot;: &quot;&quot;, &quot;merchantState&quot;: &quot;&quot;, &quot;merchantZip&quot;: &quot;&quot;, &quot;cardPresent&quot;: false, &quot;posOnPremises&quot;: &quot;&quot;, &quot;recurringAuthInd&quot;: &quot;&quot;, &quot;expirationDateKeyInMatch&quot;: false, &quot;isFraud&quot;: false}
  </code></pre>
  <p>What I want is to get a panda dataframe like this</p>
  <pre><code> accountNumber  customerId  creditLimit availableMoney  transactionDateTime transactionAmount   merchantName    acqCountry  merchantCountryCode posEntryMode    ... echoBuffer  currentBalance  merchantCity    merchantState   merchantZip cardPresent posOnPremises   recurringAuthInd    expirationDateKeyInMatch    isFraud
  0   737265056   737265056   5000    5000.0  2016-08-13T14:27:32 98.55   Uber    US  US  02  ... NaN 0.0 NaN NaN NaN False   NaN NaN False   False
  </code></pre>
  <p>When I executed the code below, simply reading JSON and convert to Pandas, I don't get values; but each cell includes dictionary as well. I also tried json_normalize, but the issue is not all columns are aligned. Any help would be appreciated.</p>
  <pre><code>import json
  import pandas as pd
  with open('test.txt', 'r') as f:
      data = json.load(f)
  df = pd.DataFrame(data)
  </code></pre>
  <pre><code>0   1   2   3   4   5   6   7   8   9   ... 19  20  21  22  23  24  25  26  27  28
  0   {&quot;accountNumber&quot;: &quot;737265056&quot;   &quot;customerId&quot;: &quot;737265056&quot;   &quot;creditLimit&quot;: 5000.0   &quot;availableMoney&quot;: 5000.0    &quot;transactionDateTime&quot;: &quot;2016-08-13T14:27:32&quot;    &quot;transactionAmount&quot;: 98.55  &quot;merchantName&quot;: &quot;Uber&quot;  &quot;acqCountry&quot;: &quot;US&quot;  &quot;merchantCountryCode&quot;: &quot;US&quot; &quot;posEntryMode&quot;: &quot;02&quot;    ... &quot;echoBuffer&quot;: &quot;&quot;    &quot;currentBalance&quot;: 0.0   &quot;merchantCity&quot;: &quot;&quot;  &quot;merchantState&quot;: &quot;&quot; &quot;merchantZip&quot;: &quot;&quot;   &quot;cardPresent&quot;: false    &quot;posOnPremises&quot;: &quot;&quot; &quot;recurringAuthInd&quot;: &quot;&quot;  &quot;expirationDateKeyInMatch&quot;: false   &quot;isFraud&quot;: false}
  1   {&quot;accountNumber&quot;: &quot;737265056&quot;   &quot;customerId&quot;: &quot;737265056&quot;   &quot;creditLimit&quot;: 5000.0   &quot;availableMoney&quot;: 5000.0    &quot;transactionDateTime&quot;: &quot;2016-10-11T05:05:54&quot;    &quot;transactionAmount&quot;: 74.51  &quot;merchantName&quot;: &quot;AMC #191138&quot;   &quot;acqCountry&quot;: &quot;US&quot;  &quot;merchantCountryCode&quot;: &quot;US&quot; &quot;posEntryMode&quot;: &quot;09&quot;    ... &quot;transactionType&quot;: &quot;PURCHASE&quot;   &quot;echoBuffer&quot;: &quot;&quot;    &quot;currentBalance&quot;: 0.0   &quot;merchantCity&quot;: &quot;&quot;  &quot;merchantState&quot;: &quot;&quot; &quot;merchantZip&quot;: &quot;&quot;   &quot;posOnPremises&quot;: &quot;&quot; &quot;recurringAuthInd&quot;: &quot;&quot;  &quot;expirationDateKeyInMatch&quot;: false   &quot;isFraud&quot;: false}
  </code></pre>