【发布时间】:2016-04-19 10:35:30
【问题描述】:
我有两个熊猫系列,如下所示。
bulk_order_id
Out[283]:
3 523
Name: order_id, dtype: object
和
luster_6_loc
Out[285]:
3 Cluster 3
Name: Clusters, dtype: object
现在我想要一个看起来像这样的新系列。
Cluster 3 523
我在 python 中做以下操作
cluster_final = pd.Series()
for i in range(len(cluster_6_loc)):
cluster_final.append(pd.Series(bulk_order_id.values[i], index =
cluster_6_loc.iloc[i]))
这给了我一个错误提示
TypeError: Index(...) must be called with a collection of some kind, 'Cluster 3' was passed
【问题讨论】:
标签: python pandas concat series