The ipython_genutils.text.compute_item_matrix() function is used to complete the code. Vertical sorting is inconvenient. I would like to switch the matrix sorting options through the config.
# Horizontal sorting:
return ([[ _get_or_default(items, i*nrow+c, default=empty) for c in range(ncol) ] for i in range(nrow) ], info)
# Vertical sorting:
return ([[ _get_or_default(items, c*nrow+i, default=empty) for c in range(ncol) ] for i in range(nrow) ], info)
The ipython_genutils.text.compute_item_matrix() function is used to complete the code. Vertical sorting is inconvenient. I would like to switch the matrix sorting options through the config.