Premium problem40. Replace Column with Split Columns

Medium Locked

Delete the From_To column from df and attach the standardised From/To columns (capitalised). Return the resulting DataFrame.

Input

            From_To  FlightNumber  RecentDelays              Airline
0      LoNDon_paris       10045.0      [23, 47]               KLM(!)
1      MAdrid_miLAN           NaN            []    <Air France> (12)
2  londON_StockhOlm       10065.0  [24, 43, 87]  (British Airways. )
3    Budapest_PaRis           NaN          [13]       12. Air France
4   Brussels_londOn       10085.0      [67, 32]          "Swiss Air"

Output

   FlightNumber  RecentDelays              Airline      From         To
0       10045.0      [23, 47]               KLM(!)    London      Paris
1           NaN            []    <Air France> (12)    Madrid      Milan
2       10065.0  [24, 43, 87]  (British Airways. )    London  Stockholm
3           NaN          [13]       12. Air France  Budapest      Paris
4       10085.0      [67, 32]          "Swiss Air"  Brussels     London

Premium problem

This one's part of Premium. Unlock the full Pandas track plus every other premium problem on the site.

Implement solve(...)