I created a column with the word count of a record with
all_essays = all_essays[essay_cols].apply(lambda x: ' '.join(x), axis=1) all_data["essay_len"] = all_essays.apply(lambda x: len(x))
This command actually gives me the count of the number of words in a string.
But how can I make a field with the average word length and frequency of certain words?
I should count individual words in a string, get their length and divide them by the number of words. In the second case, I should retrieve specific words from a string and count them. And all as a lambda function.
Any tips on those?..