Suppose I have a column in a dataframe with strings. I want to create a grouping technique so that the length of the string is matched and then the character of the string is also matched to acknowledge it as a specific group.
The output should be grouped like the below provided sample:
Rule                      Group
x                           1
x                           1
xx                          2
xx                          2
xy                          3
yx                          3
xx                          2
xyx                         4
yxx                         4
yyy                         5
xyxy                        6   
yxyx                        6
xyxy                        6
 
    