标签: python-3.x pandas performance jupyter-notebook iteration
我正在尝试从另一列替换某一列的值,但是它太慢了,与该条件匹配的行数约为5000
for index, row in voter.iterrows(): if row['TOTINC'] == 0: voter['TOTINC'][index] = voter['INC'][index]
有什么方法可以使其更快,因为这大约需要40-50秒