compare csv files by ID column
你好,我是新这个优秀的程序;我需要他lp to perform the following task: I have two csv files two common columns (ID and emotion) I would like to create a task to compare these two files and get as a result two documents in which are shown in one all the ids with the same emotion and in another the ids with different emotions; for example id 001 file A felicity emotion, B emotion sadness file will be placed in the file with different emotions. Could you tell me step by step how should I do? Thank you
0
Best Answer
-
lionelderkrikor Moderator, RapidMiner Certified Analyst, MemberPosts:1,195Unicorn
Hi again@giorogo,
You can find here the complete process of what you want to do, based on the@mschmitz' s idea :
<连接from_op = "Read CSV" from_port="output" to_op="Set Role" to_port="example set input"/>
<连接from_op = "Set Role" from_port="example set output" to_op="Join" to_port="left"/>
<连接from_op = "Read CSV (2)" from_port="output" to_op="Set Role (2)" to_port="example set input"/>
<连接from_op = "Set Role (2)" from_port="example set output" to_op="Join" to_port="right"/>
<连接from_op = "Join" from_port="join" to_op="Filter Examples" to_port="example set input"/>
<连接from_op = "Filter Examples" from_port="example set output" to_port="result 1"/>
<连接from_op = "Filter Examples" from_port="unmatched example set" to_port="result 2"/>I hope it helps,
Regards,
Lionel
0
Answers
Hi,
I think what you want to do is a join operator first where the key attribute is "id" in both sides.
The result is a table like this:
Afterwards, you use a Filter Example operator to split the table into to parts. the ones were annotation=emotion and the other.
Best,
Martin
Dortmund, Germany
First of all thanks for the reply; unfortunately now the problem is in Filter example; is the configuration in the images correct?
Hi@giorogo,
You have to put a twoSet Roleoperators after your 2Read CSVoperators
ans set youridattribute asidin the parameter panel.
Here a screenshot of the process :
ttgt
Regards,
Lionel
I've done but I have this error (see images).
Thank you very much for your help !!! Problem solved! You are very kind