Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

remove characters in array of string python

lst = [("aaaa8"),("bb8"),("ccc8"),("dddddd8")]
print([s.strip('8') for s in lst]) # remove the 8 from the string borders
print([s.replace('8', '') for s in lst]) # remove all the 8s
Comment

PREVIOUS NEXT
Code Example
Python :: pandas sort values group by 
Python :: python in line conditional statement 
Python :: pyspark take random sample 
Python :: return column of matrix numpy 
Python :: one line input in python 
Python :: plt change legend coordinates 
Python :: python remove duplicates from list 
Python :: argparse multiple arguments as list 
Python :: python create random matrix 
Python :: how to make a never ending loop in python 
Python :: flask clear session 
Python :: how to convert string to function name in python 
Python :: show aruco marker axis opencv python 
Python :: keras read image 
Python :: data science standard deviation 
Python :: pyqt5 display math 
Python :: how to check if two columns match in pandas 
Python :: download files requests python 
Python :: read csv uisng pandas 
Python :: python datetime subtract seconds 
Python :: how to convert string to date object in python 
Python :: pandas unnamed zero 
Python :: how to make square shape python 
Python :: sqlalchemy validation 
Python :: audacity 
Python :: align columns to left pandas python 
Python :: sort column with numeric and text data 
Python :: how to print a float with only 2 digits after decimal in python 
Python :: Python find inverse of matrix 
Python :: on message discord py 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =