title: Unpack JSON lines to pandas dataframe
body: <p>I am dealing with the JSON line format and trying to &quot;unpack&quot; the dictionary objects inside a single list. Since it's using a list to save the dictionary object, I haven't found any post that deals with the issue before. The data looks like this, which there are bunch of nested dictionaries inside a list object:</p>
  <pre><code>0        [{'created_at': 'Sun Jun 14 20:20:28 +0000 202...
  1        [{'created_at': 'Sat Jul 25 22:30:14 +0000 202...
  2        [{'created_at': 'Sat May 30 02:22:04 +0000 202...
  3        [{'created_at': 'Tue May 05 16:54:05 +0000 202...
  4        [{'created_at': 'Sat Jun 20 13:50:23 +0000 202...
                                 ...                        
  17453    [{'created_at': 'Mon Apr 13 01:01:10 +0000 202...
  17454    [{'created_at': 'Fri Jul 17 09:00:50 +0000 202...
  17455    [{'created_at': 'Sun Jun 21 00:51:54 +0000 202...
  17456    [{'created_at': 'Tue Jun 02 18:23:49 +0000 202...
  17457    [{'created_at': 'Thu May 28 00:27:01 +0000 202...
  </code></pre>
  <p>What I've tried now is:</p>
  <pre><code>with open('data') as file:
      lines = file.read().splitlines()
  df_inter = pd.DataFrame(lines)
  df_inter.columns = ['json_element']
  </code></pre>
  <p>For the nested ditionaries, I would use <code>pd.json_normalize(df_inter['json_element'].apply(json.loads))</code> provided by this <a href="https://ram-parameswaran22.medium.com/a-relatively-faster-approach-for-reading-json-lines-file-into-pandas-dataframe-90b57353fd38" rel="nofollow noreferrer">post</a>. However, how could I unpack the multiple dictionary-objects into a single row?</p>
  <p><strong>EDIT</strong></p>
  <p>Since the data is huge, I'll provide a partial single line of data:</p>
  <pre><code>[{'created_at': 'Sun Jun 14 20:20:28 +0000 2020', 'id': 1272262651100434433, 'id_str': '1272262651100434433', 'truncated': False, 'display_text_range': [0, 243], 'entities': {'hashtags': [{'text': 'Tenet', 'indices': [82, 88]}], 'symbols': [], 'user_mentions': [], 'urls': [], 'media': [{'id': 1272262640753094656, 'id_str': '1272262640753094656', 'indices': [244, 267], 'media_url': 'http://pbs.twimg.com/media/Eaf8IYsWsAAHVHV.jpg'...}]
  </code></pre>