i want to check whether the values in a dataframe are smaller than their predecessors AND their successors. If so, the value should be overwritten.
Can anyone explain to me, why this is not working?
Code: Alles auswählen
df2=deepcopy(df1)
i=0
for i in range(10,(len(df2)-1)):
if (df2.loc[i+1,('Klemme03Value2')])>(df2.loc[i,('Klemme03Value2')]):
if (df2.loc[i-1,('Klemme03Value2')])>(df2.loc[i,('Klemme03Value2')]):
(df2.loc[i,('Klemme03Value2')])=((df2.loc[i+1,('Klemme03Value2')]))
Tobias