【发布时间】:2017-07-01 20:39:29
【问题描述】:
我的数据框看起来像
Phrase Sentiment
[seri, escapad, demonstr, adag, good, goos] 1
[seri, escapad, demonstr, adag, good, goos] 2
当我使用命令df.dtypes
Phrase object
Sentiment int64
dtype: object
我需要获取如下数据框:
Phrase Sentiment
seri escapad demonstr adag good goos 1
seri escapad demonstr adag good bad 2
我试过这个代码
df['Phrase'] = df[df.Phrase.map(lambda x: ','.join(x))]
我应该怎么做
【问题讨论】:
-
您好,您可以将列表转换为字符串...但是..您想对 DF 做什么?
-
@Ika8 情绪分析
标签: python arrays pandas dataframe