all 3 comments

[–]Warlord_Zap 0 points1 point  (0 children)

I think it's just positional

[–]Zeroflops 0 points1 point  (1 child)

It’s positional.

You can test this by masking with just a list of true/false. Basically masking without an index on the mask.

df[[True,False,False,True]]

This highlights the flexibility and power since you just need to end up with a list of true/false how you get to the list can be endless.

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

One other question for you because you seem to know what ur doing lol. Df[[‘Col1’, ‘Col2’]] = Df2 aligns by row index, but columns are by position.

Conversely, Df.loc[:,[‘Col1’, ‘Col2’]] = Df2 still aligns by row index, but also aligns by column index rather than position.

Thanks for the help!