Python Forum

Full Version: finding exact and similar matches from pandas dataframe?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have cleaned some data and created two dataframes.
Each dataframe has one column and this column contains product category names like- df1['ecommerce_cataegory_name'] & df2['my_category_name'].
These two columns are type object.
What I need to do is write a function which can-
1. find exact match between two columns and give the name
2. if no exact match found then give 3 most similar names
3. Then save above result in a csv file with column names as 'exact_match','similar_1','similar_2'and 'similar_3'.
Please suggest efficient way/solution to achieve this problem using Python 3.6.