I have a question concerning a large dataset containing a column 'text' with strings. My goal is to search for identical strings with a minimum of 20 characters in Python. The dataset that I need thus contains al these identical strings.
For example the following dataset named df:
idnr text
1 This sentence is more than 20 characters long
2 Shorter sentence
3 Short
4 Short
5 This sentence is more than 20 characters long
6 Shorter sentence
7 This sentence is more than 20 characters long
8 Shorter sentence
9 Short
10 This sentence is more than 20 characters long
11 This sentence is more than 20 characters long
12 Shorter sentence
The output should be:
idnr text
1 This sentence is more than 20 characters long
5 This sentence is more than 20 characters long
7 This sentence is more than 20 characters long
10 This sentence is more than 20 characters long
11 This sentence is more than 20 characters long
What script can I use for this in Python?