I'm picking up someone's code. I'm used to writing for loops. But don't understand the purpose of the underscore in this code.
for _, row in dfDD.iterrows():
row = row.dropna() #drop empty cols
if len(row)==1:
continue #because no operation is defined
frow = row.filter(like=agflag)
if not frow.empty:
*code continues*
I looked at the responses provided here:What is the purpose of the single underscore "_" variable in Python? and here:Underscore _ as variable name in Python
In the above case row is already a variable that's being used, so then what's the need for a throwaway variable?
Have removed the rest of the function code to keep things simple, but can provide if needed. Thanks.