I have two dataframes, both with a column 'hotelCode'
that is type string. I made sure to convert both columns to string beforehand.
The first dataframe, we'll call old_DF
looks like so:
and the second dataframe new_DF
looks like:
I have been trying to merge these unsuccessfully. I've tried
final_DF = new_DF.join(old_DF, on = 'hotelCode')
and get this error:
I've tried a variety of things: changing the index name, various merge/join/concat and just haven't been successful.
Ideally, I will have a new dataframe where you have columns [[hotelCode, oldDate, newDate]]
under one roof.
import pandas as pd
final_DF = pd.merge(old_DF, new_DF, on='hotelCode', how='outer')