Get Average Length of Strings in a Pandas DataFrame Column
Python
This short code snippet demonstrates how to calculate the average length of strings in a selected DataFrame column using Pandas str.len() function.
1| df['col_name'].str.len()).mean()
149
132
127
119