Reputation: 3161
I have two dataframes I am trying to merge. I created these DataFrames by grouping them.
Here is a copy of the code I used to create the data frame:
subdomain_wt_mx = links_webtrends_mx[['SubDomain','Page']].groupby(['SubDomain']).agg(['count'])
subdomain_aa_mx =Mexico[['SubDomain','Page URL']].groupby(['SubDomain']).agg(['count'])
When I try to merge them , I get the error below:
Common_Domain_Mx = subdomain_wt_mx.merge(subdomain_aa_mx,on=['SubDomain'])
I get a :
Key Error
Can someone please advise on how to solve this?
Upvotes: 1
Views: 98
Reputation: 38415
Use
Common_Domain_Mx = subdomain_wt_mx.merge(subdomain_aa_mx,on = 'SubDomain')
Upvotes: 0