How to merge two pandas DataFrames based on a similarity function? How to merge two pandas DataFrames based on a similarity function? pandas pandas