Get Average Length of Strings in a Pandas DataFrame Column


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()
Did you find this snippet useful?

Sign up for free to to add this to your code library