Advertisement
Guest User

Untitled

a guest
Mar 24th, 2023
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. for x in df['seller']:
  2.   counter = 0
  3.   for y in automobile:
  4.     if y in x:
  5.       counter += 1
  6.       for z in automobile:
  7.         if z in x:
  8.           counter += 1
  9.         else:
  10.           counter += 0
  11.     else:
  12.       counter += 0
  13.     if counter == 1:
  14.       df[x] = y
  15.     else:
  16.       df[x] = x
Tags: python pandas
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement