Did you know ... Search Documentation:
Pack canny_tudor -- prolog/data/frame.pl
PublicShow source
 columns_to_rows(?ListOfColumns, ?ListOfRows) is semidet
Transforms ListOfColumns to ListOfRows, where a row is a list of key-value pairs, one for each cell. By example,
[a=[1, 2], b=[3, 4]]

becomes

[[a-1, b-3], [a-2, b-4]]

Else fails if rows or columns do not match. The output list of lists suitably conforms to dict_create/3 Data payloads from which you can build dictionaries.

?- columns_to_rows([a=[1, 2], b=[3, 4]], A),
   maplist([B, C]>>dict_create(C, row, B), A, D).
A = [[a-1, b-3], [a-2, b-4]],
D = [row{a:1, b:3}, row{a:2, b:4}].