Converting a dictionary object to a Data Frame

394 views
Skip to first unread message

Min-Woong Sohn

unread,
Dec 21, 2014, 10:28:54 PM12/21/14
to julia...@googlegroups.com
Is there a way to convert a dictionary into a data frame in such a way that the keys in the dictionary become indexes in the data frame and values become a column?

Tom Short

unread,
Dec 22, 2014, 7:51:09 AM12/22/14
to julia...@googlegroups.com
Try this:

convert(DataFrame, d)   # where d is your dict

You can also use a more long-winded direct call:

DataFrame(collect(values(d)), collect(keys(d)))




Min-Woong Sohn

unread,
Dec 22, 2014, 3:41:29 PM12/22/14
to julia...@googlegroups.com
Thank you. The second method was what I was looking for.
Reply all
Reply to author
Forward
0 new messages