Answers for "data frame list value change to string"

0

data frame list value change to string

df['liststring'] = df['lists'].agg(lambda x: ','.join(map(str, x)))
Posted by: Guest on August-19-2020
0

data frame list value change to string

df['liststring'] = [','.join(map(str, l)) for l in df['lists']]
df

                lists    liststring
0  [1, 2, 12, 6, ABC]  1,2,12,6,ABC
1     [1000, 4, z, a]    1000,4,z,a
Posted by: Guest on August-19-2020

Python Answers by Framework

Browse Popular Code Answers by Language