Pandas: Convert column to dictionary with unique values as keys -


i have dataframe has following values "2" column

   2 0  0 1  0 2  1 3  1 

i wanted make dictionary out of like

{0: 2}, {1: 2}

what best way achieve column dictionary conversion!?

{v: k k, l in df.iteritems() v in l}  {0: 2, 1: 2} 

Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -