DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
if len formula applied to a column python
df['col_1'] = df['col_1'].apply(lambda x: ' '.join(x[:50].split(' ')[:-1]) if len(x) > 50 else x)
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#len
#formula
#applied
#column
#python
ADD COMMENT
Topic
COMMENT
Name
4+3 =
Submit