Johan Nilssons Lifestream

Combining numeric columns with dataframe

I have int type columns with dataframe.

I want to make a new column that will hold text representation of the row.

df['text'] = df[['project', 'from', 'to', 'score']].apply(lambda x: '_'.join(x), axis=1)

I am getting following error TypeError: ('sequence item 1: expected string or Unicode, int found', u'occurred at index 0')

How I can add casting to string with my text generation function ?

via Stack Overflow

blog comments powered by Disqus
Get the source for phplifestream at Github