DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
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
COMMENT
Name
3+3 =
Submit