8
$\begingroup$

How can I request (programmatically or otherwise) the display of more Dataset columns?

For example, this command displays only 10 of the 13 columns of the dataset:

ds = ResourcedFunction["ExampleDataset"][{"Statistics", "LakeMeadLevels"}]

Can I get Mathematica to show, say, at most 20 dataset columns?


I can "force" the display of all columns (and rows) with the function GridTableForm from the Wolfram Function Repository:

ResourceFunction["GridTableForm"][Normal@ds[Values], TableHeadings -> Normal[Keys[ds[[1]]]]]

I am looking for a (concise) Dataset solution.


I know there are (multiple) MSE questions/answers about showing more dataset rows. I hope similar solutions exist about columns.

$\endgroup$
3
  • 3
    $\begingroup$ Try: Dataset[ds, MaxItems -> {Automatic, All}] $\endgroup$ Dec 10, 2021 at 15:54
  • $\begingroup$ @DanielHuber Thanks! Please submit an answer. (And, yes, MaxItems is linked in 'Dataset`'s function page.) $\endgroup$ Dec 10, 2021 at 16:27
  • $\begingroup$ To the person who proposed this question to be closed as "easily found in the documentation" -- maybe that is true, but I googled/searched for more than 5-10 minutes without finding relevant answers. I was getting lots of MSE hits, though, for increasing the number of rows (displayed by Dataset.) So, I think having an "increased Dataset columns" question with an answer is useful. $\endgroup$ Dec 11, 2021 at 1:36

1 Answer 1

12
$\begingroup$

You can achieve this with Dataset and the option MaxItems -> {Automatic, All}:

Dataset[ds, MaxItems -> {Automatic, All}]

enter image description here

See MaxItems's function page.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.