You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi I am trying to do the following: from a data table that is called products_web (web products) I need to match with matches in their descriptions with the description of the company's products. For example so I have the products in the one table I have the ones coming from the web and the other table is the internal products of the company. The third table contains all the matches of the web products in the internal products table. That is an example to follow.
I was thinking to make that when I have more than 2 matches then that web product conindenica is attached. But it didn't give me anything.
Here's what I was doing:
# Now we are going to iterate each value that is inside the array created in product_name and we are going to search if it is in the product column of the SKUs segmentation.
# if it is then we add it to a list of matches
# if it is not there then we add it to a list of no matches
# if it is not in either list then we add it to a not found list
matches = []
no_matches = []
not_found = []
# Iterate over each value in product_name and search for matches in the "product" column of df_internal
for index, row in df_web_.iterrows():
count = 0
for word in row["product_name"]:
print(f "Searching for word: {word}")
if word.lower() in df_internal["product"].str.lower().values:
count += 1
print(f "Match found for: {word}")
else:
not_found.append(word).
if count >= 2:
matches.append(row).
else:
no_matches.append(row).
print("Words not found:")
print(set(no_matches_found))
I have thousands of products that I must make this transformation: and for example already with real data I have like this:
what has a list inside product_name corresponds to web products and the other picture corresponds to the internal description of the company.
Thanks
Guidelines
I have read and understood this category's guidelines before making this post.
Programming HelpProgramming languages, open source, and software development.
1 participant
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Body
Hi I am trying to do the following: from a data table that is called products_web (web products) I need to match with matches in their descriptions with the description of the company's products. For example so I have the products in the one table I have the ones coming from the web and the other table is the internal products of the company. The third table contains all the matches of the web products in the internal products table. That is an example to follow.
I was thinking to make that when I have more than 2 matches then that web product conindenica is attached. But it didn't give me anything.
Here's what I was doing:
I have thousands of products that I must make this transformation: and for example already with real data I have like this:
what has a list inside product_name corresponds to web products and the other picture corresponds to the internal description of the company.
Thanks
Guidelines
Beta Was this translation helpful? Give feedback.
All reactions