Pandas - Data Frame - Reshaping Values in Data Frame
<p>I am new to Pandas and have a data frame with a team's score in 2 separate columns. This is what I have.</p>

<pre><code>Game_ID Teams   Score

1    Team A  95
1    Team B  85
2    Team C  90
2    Team D  72
</code></pre>

<p>This is where I would like to get to and then ideally to.</p>

<pre><code>1   Team A  95 Team B  94
2   Team C  90 Team B  72 
</code></pre>

<p>Knowing that games always involve exactly 2 teams, we can manipulate the underlying numpy array.</p>

<pre><code>pd.DataFrame(df.values[:, 1:].reshape(-1, 4),
             pd.Index(df.values[::2, 0], name='Game_ID'),
             ['Team', 'Score'] * 2)
</code></pre>

<p><a href="https://i.stack.imgur.com/YZPPL.png" rel="nofollow"><img src="https://i.stack.imgur.com/YZPPL.png" alt="enter image description here"></a></p>

python pandas dataframe