title: How to format JSON properly when I save to file using Python Pandas?
body: <p>A source JSON file looks like this:</p>
  <pre><code>{
   &quot;Ke1&quot; : [
     {
      &quot;Key2&quot; : [
     { xxx
  }
  ]
  }
  ]
  }
  </code></pre>
  <p>When I update the file using <code>df=pd.DataFrame(data) df.to_json(new_file)</code> it saves as:</p>
  <pre><code>{&quot;Key1&quot;:{&quot;0&quot;:{&quot;Key2&quot;:[{ xxx }]}}}
  </code></pre>
  <p>I need it to be saved in original format. Without id 0 and as a list of Key2 (the second bracket was <code>[</code> and it turned to <code>{</code> ). How to achieve this?</p>