我有这样的东西。你知道吗
Sentence Target
We regret to inform you about the result. 1
We are glad to inform you about the result. 2
We would like to inform you about the result. 3
We are surprised to see the result. 4
我想要一个像这样的字数
Word Target 1 Target 2 Target 2 Target 4
Result 1 1 1 1
Inform 1 1 1 0
Surprised 0 0 0 1
。。。等等。我该怎么做?你知道吗
你需要
stack
创建序列groupby
在Target
value_counts
unstack
所需输出的结果相关问题 更多 >
编程相关推荐