DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
df to dict
>>> df.set_index('ID').T.to_dict('list') {'p': [1, 3, 2], 'q': [4, 3, 2], 'r': [4, 0, 9]}
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#df
#dict
ADD COMMENT
Topic
COMMENT
Name
2+6 =
Submit