compare two dataframes with different number of rows?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

compare two dataframes with different number of rows?

king01
hi just new to this course:

is it possible to join two dataframes to form a new dataframe and compare
each element by df.column to find the difference and assign the logical
value for indexing? eg.

df1=                   df2                            dfNew=                  

 c    b    p          c   b   p          c1   c2   b1   b2   p1    p2   diff  
newcol logical  
01  aa   100       01 aa  110       01   01   aa   aa   100  110    10      
0    
02  bb   200       02 bb  200       02   02   bb   bb   200  200     0      
1
03  cc   300       na na  na         03   na   cc   na   300  na    300      
0
na  na   na         04 dd  50         na   04   na   dd    na  50      50      
0

how am i going do it in octave or is there any wiser solution for these?
thanks in advance.



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-Maintainers-f1638794.html

Reply | Threaded
Open this post in threaded view
|

Re: compare two dataframes with different number of rows?

Rik-4
On 12/08/2017 09:00 AM, [hidden email] wrote:
Subject:
compare two dataframes with different number of rows?
From:
king01 [hidden email]
Date:
12/08/2017 12:08 AM
To:
[hidden email]
List-Post:
[hidden email]
Content-Transfer-Encoding:
7bit
Precedence:
list
MIME-Version:
1.0
Message-ID:
[hidden email]
Content-Type:
text/plain; charset=us-ascii
Message:
3

hi just new to this course:

is it possible to join two dataframes to form a new dataframe and compare
each element by df.column to find the difference and assign the logical
value for indexing? eg.

df1=                   df2                            dfNew=                   

 c    b    p          c   b   p          c1   c2   b1   b2   p1    p2   diff  
newcol logical   
01  aa   100       01 aa  110       01   01   aa   aa   100  110    10      
0     
02  bb   200       02 bb  200       02   02   bb   bb   200  200     0       
1
03  cc   300       na na  na         03   na   cc   na   300  na    300      
0
na  na   na         04 dd  50         na   04   na   dd    na  50      50      
0

how am i going do it in octave or is there any wiser solution for these? 
thanks in advance.

I think you should post your question on the help-octave mailing list.  The octave-maintainers list is intended for developers of Octave and is unlikely to have the readers who would be answering your question.

--Rik