Is there a single function that prints an array together with the indices?
I know how to achieve this with Grid[{Range[n],array},Frame->All], but I vaguely
recall there is a special function that achieves this?
I am not finding it via searches...
Is there a single function that prints an array together with the indices?
I know how to achieve this with Grid[{Range[n],array},Frame->All], but I vaguely
recall there is a special function that achieves this?
I am not finding it via searches...
TableForm does the trick:
array = {{"a", "b", "c", "d"}};
TableForm[array, TableHeadings -> {None, Automatic}]

More flexible would be a MapIndexed-based solution:
Grid[MapIndexed[{#2[[1]], #} &, array[[1]]] // Transpose,
Frame -> All]

TableForm, but did not see the TableHeadings modifier. Thanks!
– Joseph O'Rourke
Dec 22 '14 at 13:49