1
我有带数据框的int
类型列。将数字列与数据框结合起来
我想创建一个新列,它将保存行的文本表示。
df['text'] = df[['project', 'from', 'to', 'score']].apply(lambda x: '_'.join(x), axis=1)
我收到以下错误TypeError: ('sequence item 1: expected string or Unicode, int found', u'occurred at index 0')
如何,我可以用我的文本生成函数添加casting to string
?