Suppose I have the following dataframe:
df = pd.DataFrame({'col1': ['abc', 'defg', 'hwer', 'qwerty'], 'col2': ['123', '456', '890', '90'],
'col3': ['knlk', 'knl', 'op', 'tui']})
And I want to join the strings from each row by a specific character, I'm doing like this:
df['col4'] = df['col1'] + '_' + df['col2'] + '_' + df['col3']
But I have to keep repeating the '_', is there a way to do something like:
df['col4'] = '_'.join([df['col1'], df['col2'], df['col3']])
