I have a "empty" data frame looking as follows:
6807 6809 5341
126293 nan nan nan
126294 nan nan nan
126295 nan nan nan
The column names give me an name_id whereas the index values give me a file_id. Now I want to search for the file_id and the name_id in separate pandas data frames named pro, cont, and neutral which look like this:
file_id name_id
0 126293 7244
1 126293 4978
2 126293 5112
3 126293 6864
If I find the file_idand name_idin the prodataframe I want to fill the empty data frame cell above with 1, when found in cont then -1 when in neutral, then the value entered into the matrix should be 0. Giving me a result like this, e.g.:
6807 6809 5341
126293 1 -1 0
126294 0 -1 0
126295 1 -1 1
Does someone know how to get this done?