Group Abstract Group Abstract

Message Boards Message Boards

0
|
3.1K Views
|
4 Replies
|
4 Total Likes
View groups...
Share
Share this post:

How can I display a dataset that has only 1 row horizontally?

I have noticed that if one has a Dataset with multiple rows, the dataset is displayes with the keys horizontally at the top and the rows are displayed one under the other vertically. However, if the dataset only has 1 row, the keys are displayed vertically to the left, in column fashion with the values to the right of the keys. Is there any way to have a single row Dataset to be shown horizontally?

POSTED BY: Henrick Jeanty
4 Replies

Thank you Rohit. I will go back and reread that part of the documentation.

POSTED BY: Henrick Jeanty
Posted 3 years ago

This behavior is documented, see "Dataset Structure" under "Details and Options". A single Association is treated as a table with named rows.

POSTED BY: Rohit Namjoshi
POSTED BY: Henrick Jeanty
Posted 3 years ago

This isn't generally true. Dataset[{<|"a" -> 1, "b" -> "x", "c" -> {1}|>}] displays in the horizontal orientation, and it's a dataset with one row.

Please provide code that displays the behavior you want to discuss and then ask a specific question about what you want to achieve.

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