Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas cleaning dataframe regex

df.historical_rank = df.historical_rank.str.replace(r"^(d{1,4})s|.+", r'1')
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pandas #cleaning #dataframe #regex
ADD COMMENT
Topic
Name
3+2 =