I am hoping you can help.
I have a dataframe with duplicate string values but different Index aka ID values. I am trying to find the index/IDs values where the strings are duplicates with the twist to compare the first index/ID values with the duplicate row index/IDs.
Here is a sample for the input data:
import pandas as pd
data = [[1, 'online delivery, and now offer dedicated learning platforms...'],
[7, 'verything is in a state of change. There ...'],
[52, 'online delivery, and now offer dedicated learning platforms...'],
[84, 'verything is in a state of change. There ...'],
[5699, 'online delivery, and now offer dedicated learning platforms...'],
[105687, 'you have managed to get ahead'],
[654684684, 'More Strings']
]
df = pd.DataFrame(data, columns=['Index_ID', 'Strings'])
df.set_index('Index_ID', inplace= True)
df
Here is a sample for the format of the ideal output data:
import pandas as pd
data = [[1, 52],
[1, 5699],
[7, 84]
]
duplicate_indexes = pd.DataFrame(data, columns=['First_Index_ID', 'Duplicate_Index_ID'])
duplicate_indexes
The dataframe I am working with is large with long strings, this an effort to reduce the size but retaining the Indexes/IDs
Thank you

