python get_loc not returning number 1

python get_loc not returning number

match = match.loc[:, ~match.columns.duplicated()]

Here is what the above code is Doing:
1. We’re creating a new dataframe called match that is a copy of the original dataframe.
2. We’re using the .loc method to select all rows and all columns except the last one.
3. We’re using the .duplicated method to find all the duplicate columns.
4. We’re using the ~ operator to invert the selection.
5. We’re using the .loc method again to select all rows and all columns that are not duplicated.

Similar Posts