【发布时间】:2019-02-08 20:17:06
【问题描述】:
我有一个这样的 4 列数据框
Asset1 Asset2 Asset3 Asset4
a b c d
e f g h
我想使用itertools.combinations 创建一个列来给我一个独特组合的结果,所以理想的输出是:
Asset1 Asset2 Asset3 Asset4 test
a b c d [abc, abd, bcd, acd]
e f g h [efg, efh, egh, fgh]
我尝试使用.join() 和组合但不起作用。有什么想法吗?
【问题讨论】:
标签: python python-3.x pandas dataframe combinations