I am trying to count the number of words in each row on a column using
df['new_column'] = df.column1.apply(lambda x: len(str(x).split(' ')))
This is creating a new column in my df with the number of words from column'column1'. I want to color the cells from 'column1' which, have less than 5 words. Is there a way I can do this with python applicable to all rows in the column 'column1'?
column 1
Camiseta Tecnica hombre barata
deportivas calcetin hombres running
Camiseta Tecnica mejores deportivas running Camiseta
Thanks a lot