the following problem:
Three columns (starting location, destination, distance) are to be transformed into a matrix, i.e. as follows:
Is there a way to do this?
(Two difficulties, if I see it correctly: Firstly, the distance from i.e. A to B may differ from the distance from B to A, depending on the routing.
Secondly, “zero-rows”, i.e. from A to A equals 0, would still have to be inserted – maybe before creating the matrix.)
you can simply use Pivoting node with From as grouping column, To as pivoting column and First aggregation on Distance column. Then use Column Resorter and Missing Value nodes to resort columns and replace missing values on diagonal with zeros if necessary.
@rd2575691: Thank you for the workflow and the script. Although the Python node stops at 30% in my workflow, I have finally installed the Anaconda Environment in KNIME .
Christian