I am trying to sort my columns base on the average of each column higher to lower. I was trying to work with the Reference Column Resorter, but somehow I don’t manage to work it out. Any examples using this node?
I’m not aware of a single node implementing the task you want to achieve. Other people in the forum may bring this information to you if there is one. In the meanwhile, this is how I would solve it:
Calculate the average of every column using the -groupby- node.
Transpose the result so that you get two columns: 1st column is names of columns; 2nd column is their average.
Sort the previously transposed table from higher to lower using the -Row Sorter- node, based on “names of columns”.
Use the previously sorted transposed table to input to your -Reference Column Resorter- node as reference table.
The rough idea is here but if not clear enough, just tell me please and I’ll be happy to provide the modified workflow solution.
Hope this helps.
Best
Ael
PS: Please be aware that I have modified here my first suggested solution (wrt my first post) since what the -Reference Column Resorter- expects as 2nd input table is a column with the names of the columns as rows in the desired order.