I'm working with college basketball data. The two fields I have right now are the raw matchup and the predicted winner.
| RawMatchup | PredictedWinner |
|---|---|
| MinnesotaLouisville | Louisville |
I want to use the Predicted Winner to separate out the two teams in the RawMatchup column. Currently I'm using replace to remove the Predicted Winner from the RawMatchup.
RawMatchup.replace(PredictedWinner, '')
>>Minnesota
This works for the vast majority of the rows in my dataset. The problem I'm having is when both school's partially share a name
| RawMatchup | PredictedWinner |
|---|---|
| GeorgiaGeorgia Tech | Georgia |
| North Carolina CentralNorth Carolina | North Carolina |
Using split for these two rows returns just 'Tech' and 'Central' (instead 'Georgia Tech' and 'North Carolina Central'). How can I best separate the Predicted Winner from the Raw Matchup while preserving the correct school names?