Question:In Python, the variable name
_(underscore) is often used for throwaway variables (variables that will never be used, hence do not need a proper name).
With the walrus operator,
:=, I see the need for a variable that is rather short lived (used in say only one line of code). I wonder if the use of
_is reasonable to use also in this case, or if it might be confusing for someone reading the code?
dummycould in my opinion be replaced with
Answer:You are using the variable
dummy, to filter the series. Therefore, don’t replace it with
If you have better answer, please add a comment about this, thank you!