有了这个数据帧,当line_race
等于零时,如何有条件地将rating
设置为0?
line_track line_race rating foreign
25 MTH 10 84 False
26 MTH 6 88 False
27 TAM 5 87 False
28 GP 2 86 False
29 GP 7 59 False
30 LCH 0 103 True
31 LEO 0 125 True
32 YOR 0 126 True
33 ASC 0 124 True
换句话说,在数据帧上,如果ColumnA=x,那么ColumnB=y else ColumnB=ColumnB,正确的说法是什么
使用numpy.where表示如果ColumnA=x,那么ColumnB=y else ColumnB=ColumnB:
相关问题 更多 >
编程相关推荐