Skip to content
Back to formatted view

Raw Message

Message-ID: <CABbYsteQEn6+WqNbMbHHzdM+mmyOkYYdqF=0+xHUj91bf_c=eg@mail.gmail.com>
Date: 2016-06-10T16:14:49Z
From: Abraham Mathew
Subject: Merging two data frame with different lengths

So I have two data frames.

The first one is a reccomendation data frame and the second is a melted
list with a pairing of OpportunityId's and ProductId's. There are multiple
product id's per an opportunty id. What I want to do is merge based on
ProductId so that I can add the OpportunityId to the reccomendation data
frame.

> head(product_neighbours_orig[,1:3],2)           ProductId   Reccomendation_1   Reccomendation_2
1 01t30000001ik30AAA 01ta0000005SivAAAS 01ta0000005RQimAAG
2 01t30000001ik3vAAA 01t30000001ik5bAAA 01t30000001ikKPAAY>
head(pd_melt[,1:3],2)          OpportunityId          ProductId value
4826 0063000000bqUKlAAM 01t30000001ik3vAAA     0
9651 0063000000bqUKlAAM 01t30000001ik41AAA     0





Any suggestions?

-- 


*Abraham MathewData Ninja and Statistical Modeler*



*Minneapolis, MN720-648-0108 at abmathewksAnalytics_Blog
<https://mathewanalytics.wordpress.com/>*

	[[alternative HTML version deleted]]