Suppose I have a dataframe like this:
df = pd.DataFrame({'A': ["asdfg", "abcdef", "ababab", "ghhzgghz", "qwerty"], 'B': [1, 2, 3, 4, 5]})
df.head()
O/P:
A B
asdfg 1
abcdef 2
ababab 3
ghhzgghz 4
qwerty 5
How do I go around and validate if there are any repeated sub-string/s within column A?
A B C
asdfg 1 False
abcdef 2 False
ababab 3 True (matches for ab)
ghhzgghz 4 True (matches for gh)
qwerty 5 False
A general logic for return s in (s + s)[1:-1]
, but I want it to be streamlined for any general substring repetition within each of these rows.