pandas len code example
Example 1: make length string in pandas
df['name_length'] = df.Name.str.len()
// or
df['name_length'] = df.Name.apply(len)
Example 2: pandas count
>>> df.set_index(["Person", "Single"]).count(level="Person")
Age
Person
John 2
Lewis 1
Myla 1