title: How to create the given jSON format from a pandas dataframe?
body: <blockquote>
    <p>The data looks like this :</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/WmDRw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WmDRw.png" alt="enter image description here"></a></p>
  
  <blockquote>
    <p>The expected Json fomat is like this</p>
  </blockquote>
  
  <pre><code>    {
      "DataExtractName": "SalesDataExtract",
      "BusinessName" : {
          "InvoiceDate": {
              "SourceSystem": {
                  "MYSQL" : "Invc_Dt",
                  "CSV" : "Invc_Date"
              },
              "DataType": {
                  "MYSQL" : "varchar",
                  "CSV" : "string"
              }
          },
          "Description": {
              "SourceSystem": {
                  "MYSQL" : "Prod_Desc",
                  "CSV" : "Prod_Descr"
              },
              "DataType": {
                  "MYSQL" : "varchar",
                  "CSV" : "string"
              }
          }
      }
  },
  {
      "DataExtractName": "DateDataExtract",
      "BusinessName" : {
          "InvoiceDate": {
              "SourceSystem": {
                  "MYSQL" : "Date"
              },
              "DataType": {
                  "MYSQL" : "varchar"
              }
          }
      }
  }
  </code></pre>
  
  <p>How do i achieve this using python dataframes? Or do i need to write some script to make the data like this?</p>
  
  <p><strong>Note</strong></p>
  
  <p>I've tried using - </p>
  
  <ol>
  <li>df.to_json</li>
  <li>df.to_dict</li>
  </ol>