My dataframe contains three array columns having same length
| col_1 | col_2 | col_3 |
|-------------------------|-------------------------|------------------------------|
|['a', 'b', 'c', 'd', 'e']|['n', 'n', 'n', 'd', 'd']|['cl', 'cl', 'cl', 'en', 'en']|
|['d', 'e', 'f', 'g', 'h']|['d', 'd', 'd', 'n', 'n']|['de', 'de', 'de', 'me', 'me']|
|['a', 'd', 'e', 'b', 'c']|['p', 'p', 'c', 'c', 'c']|['it', 'it', 'cs', 'cs', 'cs']|
I want to join the strings in col_1 using group by in col_3. The corresponding string should be in col_2. My output dataframe should like this.
| col_1 | col_2 | col_3 |
|-------------|----------|------------|
|['abc', 'de']|['n', 'd']|['cl', 'en']|
|['def', 'gh']|['d', 'n']|['de', 'me']|
|['ad', 'ebc']|['p', 'c']|['it', 'cs']|
Final dataframe columns should have same length