So, I am currently working on some datasets with Google Sheets and looking into automatizing some of my processes, such as calculating the f1 scores of my data. Since I usually have a bunch of worksheets at a time with the same structures, I usually have spreadsheets containing worksheets with the data and separate spreadsheets containing the "template" of my F1-score calculation (or other contents I might wanna add). I'm now wondering what ways there are to automatically merge the two together (as opposed to copy pasting them), all results I've thought of so far into are somewhat hacky and I'd prefer a clean solution that I can apply to any similar issues.
To make it more clear, I've prepared a minimal example. My data might be following the structure of this table:
| Data Text | Expected | Result |
|---|---|---|
| data 1 | abc | abc |
| data 2 | def | |
| data 3 | def | def |
| data 4 |
Then my template might look something like this (I could also add the column headers of the data if that would help in any way, but I usually don't):
| Entity | Interesting Value | Interesting Value 2 | Interesting Value 3 | |||
|---|---|---|---|---|---|---|
| abc | just | a | template | |||
| def | some calculations | some contents | things |
And then the result would have both combined like this:
| Data Text | Expected | Result | Entity | Interesting Value | Interesting Value 2 | Interesting Value 3 |
|---|---|---|---|---|---|---|
| data 1 | abc | abc | abc | just | a | template |
| data 2 | def | def | some calculations | some contents | things | |
| data 3 | def | def | ||||
| data 4 |
Again, I'm looking for a universal approach that will still work even if the structure of the above files differs. E.g they might follow the same principle, but maybe the data has more columns, the template differs, etc. However, my templates never overwrite columns that are given in the main data (e.g. if the data has 5 columns, the template will start at column 6 or later).
I'm writing my code in google colaboratory.
