Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pandas series add word to every item in series

#Python <3.6
df['col'] = df['col'].apply(lambda x: '{}{}'.format('str', x))
#Python 3.6+
df['col'] = df['col'].apply(lambda x: f'str{x}')
Comment

PREVIOUS NEXT
Code Example
Python :: read data from gooogle cloud storage 
Python :: Python Print hour, minute, second and microsecond 
Python :: custom pylatex command 
Python :: python remove item from a list 
Python :: index and reversing a sub list in python list 
Python :: pandas excelfile 
Python :: for in list start with index python 
Python :: 1036 solution python 
Python :: how to make reportlab table header bold in python 
Python :: where to put capybara default wait time 
Python :: series floor 
Python :: acces previous index in cycle python 
Python :: time python 
Python :: django add to cart 
Python :: fetch firestore indexes 
Python :: set index values pandas 
Python :: get nonzero min numpy 
Python :: python list insert vs append 
Python :: get path and name of file for open() 
Python :: pil saves blue images 
Python :: minio python remove a bucket 
Python :: python manage.py collectstatic 
Python :: how to looks like a hacker 
Python :: generate a random np image array with shape 
Python :: python list insert 
Python :: git clone in python to tmp directory 
Python :: python add column to a matrix 
Python :: h2o dataframe columns drop 
Python :: copy module in python 
Python :: Django Redirect Depending On Request Method 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =