I have a data frame DF like this:
DF = pd.DataFrame({'Code':['abc', 'abc', 'abc', 'abc', 'def'],
'Description':['ABC String', 'ABC String', 'ABC String and sth', 'Only sth else', 'ABC String'],
'Value':[10, 20, 30, 40, 100]})
I need to group it by Code and Description. Grouping by Code is simple:
GR = DF.groupby('Code')
Now I want to continue with grouping by Description, so all values that are equal or similar (have a common part) are grouped together. Can you help me with a formula to get something like this:
It might be there are two questions: 'equal values' and 'similar values'. If there is any hint on at least the 'equal values', that would be great.


