I have two dataframes of size roughly 1,000,000 rows each. Both share a common 'Address' column which I am using to join the dataframes. Using this join, I wish to move information, which I shall call 'details', from dataframe1 to dataframe2.
df2.details = df2.Address.map(dict(zip(df1.Address,df1.details)))
However, the address column does not exhibit entire commonality. I tried cleaning as best I could, but still can only move roughly 40% of the data across. Is there a way to modify my above code to allow for a partial match? I'm totally stumped on this one.
Data is quite simply as described. Two small dataframes. Fabricated sample data below:
df1
Address Details
Apt 15 A, Long Street, Fake town, US A
df2
Address Details
15A, Long Street, Fake town, U.S.