【发布时间】:2020-09-29 18:01:47
【问题描述】:
我有一个网球比赛的熊猫数据集,每场比赛都有获胜者和失败者:
match match_date winner loser score
match1 06June player1 player2 6-2
match2 08June player3 player1 6-4
match3 07June player1 player4 5-6
match4 12June player4 player3 6-7
数据集是基于匹配创建的,我需要从这个为每个玩家创建新的数据集:
player_name previous_match result score
player1 06June won 6-2
player1 08June lost 6-4
player1 07June lost 5-6
问题是每个玩家都可以出现在获胜者列或失败者列中,并且玩家数量很大。
【问题讨论】:
-
有具体问题吗?请参阅How to Ask、help center。