df.columns.duplicated() returns a boolean array: a True or False for each column--False means the column name is unique up to that point, True means it's a duplicate
Pandas allows one to index using boolean values whereby it selects only the True values.
Since we want to keep the unduplicated columns, we need the above boolean array to be flipped (ie [True, False, True] -> ~[False,True,False])