有没有一些聪明或Pythonic的方法在Pandas中执行以下操作?
for index, row in pd.DataFrame().iterrows():
if (row[previous_index]>=row and row[next_index]>=row):
row=(row[previous_index]+row[next_index])/2