Search
 
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
Name
4+3 =