make length string in pandas

df['name_length'] = df.Name.str.len() 

// or 

df['name_length'] = df.Name.apply(len)

Here is what the above code is Doing:
1. We’re creating a new column called ‘name_length’ in our DataFrame.
2. We’re assigning the length of each name in the ‘Name’ column to the new column.

We can use the .apply() method to do all sorts of things to columns in our DataFrame.
For example, we could use it to extract the first letter of each name in the ‘Name’ column.