I am trying to merge two dataframes, one with columns: customerId, full name, and emails and the other dataframe with columns: customerId, amount, and date. I want to have the first dataframe be the main dataframe and the other dataframe information be included but only if the customerIds match up; I tried doing:
merge = pd.merge(df, df2, on='customerId', how='left')
but the dataframe that is produced contains a lot of repeats and looks wrong:
customerId full name emails amount date
0 002963338 Star shine [email protected] $2,910.94 2016-06-14
1 002963338 Star shine [email protected] $9,067.70 2016-05-27
2 002963338 Star shine [email protected] $6,507.24 2016-04-12
3 002963338 Star shine [email protected] $1,457.99 2016-02-24
4 986423367 palm tree [email protected],[email protected] $4,604.83 2016-07-16
this cant be right, please help!