'Combine Pandas df rows into one
For every two rows in my df, I would like to concatenate them into one.
Starting with this:
and ending with this:
I've been able to apply this to one column, but have not been able to apply it across all of them. I would also like to loop this for every two rows for the entire df.
This is my actual df:
Team Spread
0 Wagner Seahawks (-11.5, -118)
1 Fairleigh Dickinson Knights (11.5, -110)
I know this isn't the best way to format a table, but for my needs it is the best option. Thank you
If I were to do this in excel - I would use this:
=TEXTJOIN(CHAR(10),TRUE,A1:A2)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|


