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
Post a Comment