I am using Python to clean address data and standardize abbreviations, etc. so that it can be compared against other address data. I finally have 2 dataframes in Pandas. I would like to compare each row in the first df, named df
, against a list created from another list of addresses in a df of similar structure, second_df
. If the address from df
is on the list, then I would like to create a column to note this, maybe a boolean, but best case the string 'found'. I have used isin
and it did not work.
For example, suppose my data looks like the sample data below. I would like to compare each row in df['concat']
to the entire list list
to see if the address in df['concat']
column appears in the second_df list.
read = pd.read_excel('fullfilepath.xlsx')
second_df = pd.read_excel('anotherfilepath.xlsx')
df = read[['column1','column2', 'concat']]
list = second_df.concat.tolist()