title: python - Convert pandas dataframe to json or dict and then back to df with non-unique columns
body: <p>I need to send a dataframe from a backend to a frontend and so first need to convert it either to an object that is JSON serialisable or directly to JSON. The problem being that I have some dataframes that don't have unique cols. I've looked into the <code>orient</code> parameter, <code>to_json()</code>, <code>to_dict()</code> and <code>from_dict()</code> methods but still can't get it to work...</p>
  
  <p><strong>The goal is to be able to convert the df to something json serializable and then back to its initial self.</strong></p>
  
  <p>I'm also having a hard time copy-pasting it using pd.read_clipboard so I've included a sample df causing problems as an image (sorry!).</p>
  
  <p><a href="https://i.stack.imgur.com/O8wMD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/O8wMD.png" alt="enter image description here"></a></p>