8

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.

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
Anton Antonov
  • 37,787
  • 3
  • 100
  • 178
  • 3
    Try: Dataset[ds, MaxItems -> {Automatic, All}] – Daniel Huber Dec 10 '21 at 15:54
  • @DanielHuber Thanks! Please submit an answer. (And, yes, MaxItems is linked in 'Dataset`'s function page.) – Anton Antonov Dec 10 '21 at 16:27
  • 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. – Anton Antonov Dec 11 '21 at 01:36

1 Answers1

12

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.

MarcoB
  • 67,153
  • 18
  • 91
  • 189
Daniel Huber
  • 51,463
  • 1
  • 23
  • 57