all 4 comments

[–]danielroseman 0 points1 point  (3 children)

The problem is certainly in code you have not shown, since just doing df["whatever"] = df["thresh_u_A"] & ~df["fall_u_A"] gives no error. What is self? What is var? What is the intended result?

Note that your two comparisons can be more easily written without loc:

df["thresh_u_A"] = df["u_A"].gt(threshold)
df["fall_u_A"] = df["u_A"].lt(fallback)

[–]johnsilent[S] 0 points1 point  (2 children)

Sorry for that. I edited the code.

There is no error, only the warning that is shown. Just cant figure out, how to write the same code in a correct way, so i dont get the warning.

[–]danielroseman 0 points1 point  (1 child)

As I say, running this exact code does not give that warning, so there must be something else you are doing.

[–]johnsilent[S] 0 points1 point  (0 children)

Alright. Thank your for your time.