I have two csvs full of contact information. My aim is to check if data from any cell in the first one are anywhere in the second one, and if so copy whole row, in which info was found and append it to new DataFrame. Is there any way to get output in well formated df?
Registered = []
string = []
o = df1.shape
p = df2.shape
xmax = o[0]
ymax = o[1]
zmax = p[0]
rmax = p[1]
found = 0
for x in range (xmax):
for y in df1:
cell = df1.iat[x,y]
repr(cell).lower()
for z in range (zmax):
for r in df2:
found = repr(key) in repr(data)
if found is True:
string = df1.iloc[[z]]
Registered.append(string)
while r <= (rmax - 2):
r = r + 1
while y <= (ymax - 2):
y = y + 1
df3 = pd.DataFrame(Registered)