Message Boards Message Boards

0
|
5487 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Understand behavior of TableForm?

Posted 6 years ago

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

POSTED BY: Daniel Huber
2 Replies

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

POSTED BY: Ian Williams

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

POSTED BY: Neil Singer
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