【发布时间】:2021-06-09 23:59:04
【问题描述】:
这是一个示例 df,以 authid 作为索引。我想将功能分成几列。原来 features 列是用 dict 填充的。
我试过 df['features'].apply(pd.Series) 但没有用。
authid features
108560005 n_clusters 2.0000
inertia 23.4968
silhouette 0.9061
trend_datapoints 355.0000
trend_slope -0.0010
trend_pvalue 0.0615
resid_std 1075.9582
123750005 n_clusters 2.0000
inertia 0.0682
silhouette 0.9961
trend_datapoints 355.0000
trend_slope 0.0046
trend_pvalue 0.0000
resid_std 75.8126
【问题讨论】:
标签: python-3.x pandas dataframe dictionary split