Change the iloc to a loc and then I would maybe see the argument.
.iloc and .loc explicitly return the original data frame, while [] indexing can in some cases return a copy. Pandas makes no promises on what you get
So depending on what the full expression was the criticism of using [] inducing could make sense. You’d need to see the full context of what OP was writing though.
From the sounds of what they wrote though, this is not the thinking the interviewer was following.
silvershadow t1_isurezr wrote
Reply to comment by phb07jm in [D] How frustrating are the ML interviews these days!!! TOP 3% interview joke by Mogady
Change the iloc to a loc and then I would maybe see the argument.
.iloc and .loc explicitly return the original data frame, while [] indexing can in some cases return a copy. Pandas makes no promises on what you get
So depending on what the full expression was the criticism of using [] inducing could make sense. You’d need to see the full context of what OP was writing though.
From the sounds of what they wrote though, this is not the thinking the interviewer was following.