ipython / ipython_genutils

Vestigial IPython utilities: DO NOT USE
Other
11 stars 22 forks source link

ipython_genutils.text.compute_item_matrix to horizontal matrix #14

Open Roffild opened 4 years ago

Roffild commented 4 years ago

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)