Hello,
What I want is to check whether I find a match between each columns of df2 with df1.
The results for each columns should be which element is matched with rows of df1.
Please check for all my effort to get this job done with no success in stack overflow. If it can be done in python, I will also appreciate any comment
1 answer
I haven't grasped the fine details of your data and your aim but it seems to me that R is not ideal for this job (although certainly possible). In python, I would do the following:
Parse the "second" file to make a reference set of unique IDs. I.e. split each row to extract the IDs and add them to the reference ID set.
Iterate through the first file. For each row extract the IDs. Test if any of these IDs are in the reference set constructed above. If so print out the row.
It's not clear to me what delimits the IDs (tab, colon, semicolon?) but using python's string.split() it should be easy to get them for each row.
Log in to answer this question.
Add a small example of your two datasets, and then an example of what the result should look like. We might be able to help you then. Off the top of my head I'm thinking
mergeormatchfunction.@Carlos Guzman small example won't help because of the structure of data. I have tried all those , look at my question in stack overflow . any solution will be ok for small example but when I use the real data , it will not work
I edited your question, using the syntax tag and reading the file directly from github.
I still can't understand the question. Could you make an example of the expected output?
I can see that the first file is taken from a complexes database (reactome), but I still can't understand the format of the second file. Can you explain what it contains?
I found a solution . Thanks