Advertisement
SuperMeatBoy

Find columns with duplicates

Jul 15th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. dup_cols = {}
  2.  
  3. for i, c1 in enumerate(tqdm_notebook(train_enc.columns)):
  4. for c2 in train_enc.columns[i + 1:]:
  5. if c2 not in dup_cols and np.all(train_enc[c1] == train_enc[c2]):
  6. dup_cols[c2] = c1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement