Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python lambda to rename multiple variables name by replacing any appearance with underscore

df1 = df.toDF(*(re.sub(r'[.s]+', '_', c).translate(None, '(){}') for c in df.columns))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #lambda #rename #multiple #variables #replacing #appearance #underscore
ADD COMMENT
Topic
Name
3+3 =