My data set comes from jira and the Labels data is separated into multiple columns, one for each label in the row. This number of rows can vary from 1 to more than 5 depending on how many label tags were used on a given entry.
The csv could look like:
Issue Type Issue key Labels Labels Labels Labels Labels
Story 123 #label1, #label2, #label6, #label7, #label9,
Story 124
Story 125 #label3, #label1,
Bug 126
Story 127 #label5,
The number of columns can vary getting a new Labels column for every tag in the row. There seems to be no way to correct the export to enclose the values as a single string.
What I'm needing to do is concatenate these into a single column "Tags", and I don't care about cleaning up the trailing comma.
I've tried
df['Tags'] = [col for col in df.columns if 'Label' in col]
But this throws an error "Length of values does not match length of index"
Is there a simple way to accomplish this when reading the CSV into the dataframe?