title: Save DataFrame as Json with non unique index
body: <p>my DF is:</p>
  
  <pre><code>df = pd.DataFrame({'city': ['POA', 'POA', 'SAN'], 'info' : [10,12,5]}, index = [4314902, 4314902, 4300803])
  df.index.rename('ID_city', inplace=True)
  
  output:
  
      city    info
  ID_city     
  4314902 POA 10
  4314902 POA 12
  4300803 SAN 5
  </code></pre>
  
  <p>I need to save as json oriented by index. The following command works only when each index is unique.</p>
  
  <pre><code>df.to_json('df.json', orient='index')
  </code></pre>
  
  <p>Is possible to save this DataFrame and when he find a duplicate index, create a array? 
  My desire output:</p>
  
  <pre><code>{ 4314902 : [ {'city': 'POA', 'info': 10} , {'city': 'POA', 'info': 11} ]
   ,4300803 : {'city': 'SAN', 'info': 5} }
  </code></pre>