【发布时间】:2017-08-10 08:22:31
【问题描述】:
我有这种熊猫数据框输出,列在第一行:
Date, Team1, Team2, Map, Event
17/3/17, Misfits 16, Cloud9 4, overpass, Pro League
17/3/17, TyLoo 16, Born Of Fire 4, cache, Pro League
17/3/17, Liquid 8, Renegades 16, cbble, Proleague
17/3/17, Earnix 16, Blight 7, overpass, Proleague
17/3/17, Selfless 12, Rush 16,, inferno, Proleague
我的目标是得到这样的输出:
Date, Team1, Team2, Team1 Score, Team2 Score, Map, Event
17/3/17, Misfits, Cloud9, 16, 4,overpass, Pro League
17/3/17, TyLoo, Born Of Fire, 16, 4, cache, Pro League
17/3/17, Liquid, Renegades, 8, 16, cbble, Proleague
17/3/17, Earnix, Blight, 16, 7, overpass, Proleague
17/3/17, Selfless, Rush, 12, 16, inferno, Proleague
如何将“Team1”和“Team2”列中的得分值分离到名为“Team1 Score”和“Team2 Score”的全新列?
【问题讨论】:
标签: python pandas dataframe jupyter-notebook