Questions on the Dataset data type and related functionality introduced in version 10. Do not use for questions on data in more generic list format or data-manipulation questions generally.
Suppose I have different functions: Total, Mean and Max and the following Dataset
SeedRandom[0]
dataSet = Dataset[AssociationThread[{"a", "b", "c", "d"} -> #] & /@ RandomReal[4, {10, 4}]]
How can I do the following: apply Total to column "b", Mean…
Using the example in the documentation, how would I make a new dataset with the key "b" changed to key "h".
dataset = Dataset[{
<|"a" -> 1, "b" -> "x", "c" -> {1}|>,
<|"a" -> 2, "b" -> "y", "c" -> {2, 3}|>,
<|"a" -> 3, "b" -> "z", "c" ->…
Assume you import data from a Table source of the following format.
<< GeneralUtilities`; fields = {"Country", "Region", "BU", "Year",
"Date", "Sales"};
organization = {{"Argentina", "LATAM", "Americas"}, {"SouthAfrica",
"Africa", "EAME"},…
A Dataset with 16 columns or less is shown in a nice way:
Association @@@
Table["col" <> ToString@j -> i j, {i, 10}, {j, 16}] // Dataset
A Dataset with more than 16 columns no.
set = Association @@@
Table["col" <> ToString@j -> i j, {i,…
I have an application for which a Dataset appears useful. I want a structured dataset which consists of a set of records, which are presumably Associations.
For the data set, I would like to be able to perform the following operations:
Add a…
According to the documentation
But If I run
Dataset@<|101 -> <|t -> 42, r -> 7.5`|>, 102 -> <|t -> 42, r -> 7.5`|>,
103 -> <|t -> 42, r -> 7.5`|>|>
I got
Which is not right.
Only if I turn t to "t" and r to "r" to run
Dataset@<|101 -> <|"t"…
I have a dataset which I group an then calculate the maximum of an item. When done I get the desired result, but have no column heads.
Here the example association (subset of my data):
tn = {<|"year" -> "2004", "month" -> "01", "different" ->…
Dataset Processing (for Life Sciences)
Note: a related, but distinct task is posted here ID Swapping: Efficient use of a reference table to convert ID values.
A common task, at least for me, involves analyzing at least two different Datasets.
A…
I am wondering if there is a straightforward way to add a new column to a dataset if the column needs to be computed from the key values rather than other columns. Here is a simple example.
dataset=<|101-><|"Column1"->"a"|>,
…
The summary box for Dataset objects shows the number of levels and elements at the bottom.
How can we get these values programmatically?
For example, "4 levels, 350 elements" in the Planets dataset:
Is there any way to make Select take a second argument (to select only the first n elems) while in operator form?
It's too slow to perform the whole selection and then take the first n, for example:
dataset =
Dataset[Table[<|"a" ->…
I have some data that I want to display as rationals.
someData={<|"utilization fraction" -> 1, "power fraction" -> 1|>, <|"utilization fraction" -> 7/8, "power fraction" -> 224/225|>, <|"utilization fraction" -> 3/4, "power fraction" -> 48/49|>,…
Mathematica 12 on wolfram cloud isn't rendering the table for an association of lists. According to the documentation you should be able to make columns in the table by:
However I tried this
$Version
thing2 = Dataset[<|"apple"…