Assuming you have two dataframes df1
and df2
which contain a column with dates that you want to merge on:
main.py70 chars4 lines
Make sure that the date format is the same in both dataframes. By default, pd.merge()
does an inner join on the two dataframes. You can adjust this behavior by specifying the how
parameter, which can take one of the following values: 'left', 'right', 'outer', 'inner'.
For example, to perform a left join:
main.py61 chars2 lines
gistlibby LogSnag