I have a dataframe that looks like this.
ac_val | node1 | node2 | node3 |
--------------------------------
val1 | | | |
val2 | | | |
val3 | | | |
from the table, I need to open up text file of each node (node1, node2, node3) and look for the ac_val (val1, val2, val3) and fill in the value into cell respectively, I would like to know if there is any efficient way to fill in the "blanks" instead of using good old iteration method.
Edit: The content of the text file looks like this (I've removed most of the codes and retain the needed one)
[node1]: xxx val 1 24
[node1]: xxx val 2 55
[node1]: xxx val 3 -44
Then the result will look like this (same goes to node2, and node 3)
ac_val | node1 | node2 | node3 |
--------------------------------
val1 | 24 | | |
val2 | 55 | | |
val3 | -44 | | |
I don't need any actual codes or whatsoever to fill the blank for me, I just wanted to know if there is any better way to solve this than using iterrows()