从pandas colum中的列表中删除字典

时间:2015-04-29 17:44:20

标签: python dictionary pandas

我有数据框,其中一列是一个字典列表,存储为字符串,如下所示:

name age misc
Jim  44  "[{"value":3,"type":"cars"},{"value":1,"type":"pets"},{"value":13,"type":"shoes"}]"
Bob  25  "[{"value":3,"type":"siblings"},{"value":1,"type":"pets"}]"
Sue  55  "[]"

我想谈谈这个问题,每个类型都有自己的列,并带有相应的值:

name age cars pets shoes siblings
Jim  44  3    1    13    0
Bob  25  0    1    0     3
Sue  55  0    0    0     0

0 个答案:

没有答案