title: Create a dictionary from DataFrame?
body: <p>I want to create a dictionary from a dataframe in python.
  In this dataframe, frame one column contains all the keys and another column contains multiple values of that key.</p>
  
  <pre class="lang-none prettyprint-override"><code>DATAKEY      DATAKEYVALUE
  name         mayank,deepak,naveen,rajni
  empid        1,2,3,4
  city         delhi,mumbai,pune,noida
  </code></pre>
  
  <p>I tried this code to first convert it into simple data frame but all the values are not separating row-wise:</p>
  
  <pre><code>columnnames=finaldata['DATAKEY']
  collist=list(columnnames)
  dfObj = pd.DataFrame(columns=collist)
  collen=len(finaldata['DATAKEY'])
  for i in range(collen):
      colname=collist[i]
      keyvalue=finaldata.DATAKEYVALUE[i]
      valuelist2=keyvalue.split(",")
      dfObj = dfObj.append({colname: valuelist2}, ignore_index=True)
  </code></pre>