Message Boards Message Boards

GROUPS:

Understand behavior of TableForm?

Posted 6 days ago
81 Views
|
2 Replies
|
0 Total Likes
|

Mathematica 11.3.0.0 Windows 10 64

This may be a silly question, but I bang my head against this cumbersome feature.

Can anybody explain where the "None " in the following output comes from (and eventually how to eliminate it):

Input:

TableForm[{{1, {1, 1}}, {2, {2, 2}}},  TableDirections -> {Row, Column, Column}]

Output ( the periods indicate spaces, otherwise the text formatter of this forum screws up the formatting):

1..............2

None...1..2

............1..2

2 Replies

Daniel,

I get the same thing. It appears to be a bug to me. This works:

TableForm[Transpose[{{1, {2, 3}}, {4, {5, 6}}}], TableDirections -> Column]

But this fails

TableForm[{{1, {2, 3}}, {4, {5, 6}}}, TableDirections -> Row]

and they should be the same. I would report that to Tech Support.

Regards,

Neil

A couple of other possible solutions are:

ls = {{1, {2, 3}}, {4, {5, 6}}, {7, {8, 9}}};
TableForm[Flatten /@ ls, TableDirections -> Row]

Or maybe:

ls = {{1, {2, 3}}, {4, {5, 6}}, {7, {8, 9}}};
TableForm[# /. {a_, b__} -> {a, Column[b]} & /@ ls, 
 TableDirections -> Row]

Hope this helps,

Ian

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract