What is the (best practice) correct way to iterate over DataFrames?
I am using:
for i in range(working.shape[0]):
for j in range(1, working.shape[1]):
working.iloc[i,j] = (100 - working.iloc[i,j])*100
The above is correct but does not line up with other Stack Overflow answers. I was hoping that someone could explain why the above is not optimal and suggest a superior implementation.
I am very much a novice in programming in general and Pandas in particular. Also apologies for asking a question which has already been addressed on SF: I didn't really understand the standing answers to this though. possible duplicate but this answer is easy to understand for a novice, if less comprehensive.