我有以下输入,其中用户以以下百分比(25 或 50 或 75 或 100)观看节目。我只想计算某个用户在某个 id 上观看的最高百分比。输入和输出如下所示。
输入
id1, u1, watched25
id2, u1, watched25
id1, u1, watched50
id1, u1, watched75
id3, u1, watched25
id4, u1, watched25
id1, u1, watched100
id2, u1, watched50
id5, u1, watched25
id5, u1, watched50
id5, u1, watched75
id5, u1, watched100
id1, u2, watched25
id1, u2, watched50
id3, u2, watched25
id3, u3, watched25
id1, u2, watched75
id4, u3, watched25
id4, u3, watched50
期望的输出
id1, u1, watched100
id2, u1, watched50
id3, u1, watched25
id5, u1, watched25
id5, u1, watched100
id1, u2, watched75
id3, u2, watched25
id3, u3, watched25
id4, u3, watched50