Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

data frame list value change to string

df['liststring'] = df['lists'].agg(lambda x: ','.join(map(str, x)))
Comment

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
Comment

PREVIOUS NEXT
Code Example
Python :: python comment multiple lines 
Python :: jinja macro import 
Python :: python plot multiple lines in same figure 
Python :: python env 
Python :: file searching in python 
Python :: import math sqrt python 
Python :: python library to make qr codes 
Python :: add system path python jupytre 
Python :: standardise columns python 
Python :: python ssh into server 
Python :: how to extract integers from string python 
Python :: python iter on a dic key value 
Python :: scroll down selenium python 
Python :: from array to tuple python 
Python :: how to create numpy array using two vectors 
Python :: get range of items of python list 
Python :: python code to receive gmail 
Python :: Python Requests Library Post Method 
Python :: tkinter get child in frame 
Python :: beautiful soup documentation 
Python :: cmd check if python is installed 
Python :: datetime date from string 
Python :: lower upper in pytho 
Python :: tqdm enumerate 
Python :: python date range 
Python :: python comment block 
Python :: xgboosat save_model 
Python :: python print odd numberrs 
Python :: how to edit messages in discord . py 
Python :: python access global variable 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =