I have the following Pandas data frame:
A1 A2 A3......... A10
2 32 41......... 11
12 44 21......... 21
10 3 90......... 80
And I am trying to create a pandas data frame with one single column with values of all other columns separated by a single space. The type of this resulting column should be an object. it should look like this:
A
2 32 41......... 11
12 44 21......... 21
10 3 90......... 80
I have tried the following code; however, that requires me to convert the datatype for each column to be a string which I do not want to do:
df['A1'] + ' ' + df['A2']+ ' ' + df['A3'] + ' ' + df['A4']+......+df['A10'].astype(str)