df = pd.DataFrame(['{"time":1,"pid":"a"}','{"time":1,"pid":"b"}'], columns=['raw'])
df.raw.apply(lambda x: pd.Series(json.loads(x)))
输出
pid time
0 a 1
1 b 1
df = pd.DataFrame(['{"time":1,"pid":"a"}','{"time":1,"pid":"b"}'], columns=['raw'])
df.raw.apply(lambda x: pd.Series(json.loads(x)))
输出
pid time
0 a 1
1 b 1
本文标题:pandas series中json字符串展开成datafram
本文链接:https://www.haomeiwen.com/subject/fucagxtx.html
网友评论