熊猫的最新版本现在包括用于遍历行的内置函数。
for index, row in df.iterrows(): # do some logic here
或者,如果你想更快地使用它
itertuples()
但是,
unutbu建议使用
numpy函数以避免对行进行迭代将产生最快的代码。

熊猫的最新版本现在包括用于遍历行的内置函数。
for index, row in df.iterrows(): # do some logic here
或者,如果你想更快地使用它
itertuples()
但是,
unutbu建议使用
numpy函数以避免对行进行迭代将产生最快的代码。