Questions tagged [dataset]

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.

Filter by
Sorted by
Tagged with
13
votes
1answer
386 views

How to make datasets display correctly?

NB: The problem illustrated below is truly ubiquitous. I hope the examples given below are sufficiently different to demonstrate this fact, and to discourage answers that hinge on the details of the ...
13
votes
1answer
341 views

Streaming`LazyList`Testing may have a leak

Bug introduced in 10.2 and fixed in 10.3 Version 10.2; Win64 Enterprise. I'm seeing this message... data::shdw: Symbol data appears in multiple contexts {Streaming`LazyList`Testing`, Global`}; ...
13
votes
1answer
4k views

How to convert a column of a Dataset into a list [closed]

I'm loving the fact that Mathematica has finally implemented the Dataset feature, but I'm still struggling a little with it. I have a Dataset that contains a bunch of functions for different diseases ...
13
votes
2answers
286 views

The equivalent of dplyr mutate with Dataset

In R, there is a package "dplyr" that works on data.frame objects, which is one of the origins of the Mathematica Dataset construct. One of the things dplyr can do is "mutate" the columns of a data....
12
votes
4answers
575 views

Dataset: get number of levels and elements

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, ...
12
votes
2answers
1k views

Import iTunes xml data and convert it into a dataset or table

I have an xml file with song data from iTunes (https://dl.dropboxusercontent.com/u/1012958/iTunes%20Library.xml) and I'd like to import it to Mathematica to do some statistics. I get an XMLObject like ...
12
votes
2answers
355 views

Query datasets with “variable” named slots

I want to query a Dataset object, e.g. select some entries using ...
12
votes
2answers
250 views

Missing: KeyGroupBy?

Especially in tree-structured data, keys and values, being two sides of the same coin, frequently interchange roles. The ability to aggregate by value but not by key upsets the balance. How to ...
12
votes
5answers
2k views

Export a simple DataSet with key-value associations to CSV in Mathematica 10

I'm trying to Export a simple dataset with key-value pairs to a CSV Export["n.csv", MyDataset, "CSV"] This results in a single-line serialization: ...
12
votes
3answers
444 views

Create a new dataset column based on the row key

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. ...
12
votes
2answers
714 views

Add column heads to a dataset

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): ...
12
votes
1answer
198 views

Using Select on Dataset with missing keys

I have a very large dataset with about a million entries with up to 75 keys each. Across the whole dataset about half of the keys are blank. In order to reduce filesize, I have used the following ...
12
votes
1answer
173 views

Possible Bug in ProbitModelFit when used in a Dataset

Since upgrading to Mathematica 10 on Mac OSX I have come across a number of instances of this error, which occurs using Probit and Logit model fit. A bit of googling show this is something to do with ...
12
votes
0answers
192 views

Internal error using part specification with Dataset

Bug introduced in 12.1.0. Fixed in 12.1.1 Update 2020-04-13 WRI has confirmed that this is a bug. CASE:4530401 Suggested workaround from WRI ...
11
votes
4answers
3k views

Join two datasets on keys

I want to be able to join two datasets by keys, pretty much like I'd do in SQL. I thought the JoinAcross function might do it, but it doesn't operate the way I thought. The example in the ...
11
votes
5answers
340 views

Select only first n elements in operator form?

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 ...
11
votes
2answers
187 views

A subtlety in Query

Let us consider a simple Dataset: ds=Dataset[{<|"a"->12,"b"->4|>,<|"a"->7,"b"->8|>,<|"b"->3|>}] Column "b" is easy to find: <...
11
votes
3answers
300 views

How to get control of Dataset display?

According to the documentation But If I run ...
11
votes
1answer
287 views

10.0.2 breaks a recursive “trie” query

Bug introduced in 10.0.2 and fixed in 10.2 The 10.0.2 Dataset type system complication breaks a recursive trie constructor that worked in 0.1: ...
11
votes
2answers
224 views

Lookup with default broken in Dataset

Given an Association, ...
11
votes
1answer
581 views

Select From List of Nested Associations

I have an association: ...
11
votes
2answers
201 views

Large Dataset query fails if column contains Missing

In version 11.0 (Win 8.1 Pro) a query on a large Dataset for a column that contains Missing fails most unceremoniously. With <...
11
votes
1answer
981 views

A comprehensive list of all correct input formats for [[experimental]] Neural Net functions?

Question: correct formats for Mathematica's NetTrain function Explanation of the problem Background So Mathematica 11 was released earlier this month, and while there are many improvements and they ...
11
votes
1answer
109 views

Nondeterministic $Failed when mapping over a Dataset

Consider the following simplified example (on Mathematica 12): ds = Dataset@{<|"hell" -> "o"|>, <|"hell" -> "no"|>}; ...
11
votes
2answers
858 views

How to merge Datasets representing matrices with named rows/columns?

I am working with square (non-symmetric) matrices with named rows and columns. The data I receive is sometimes messy and rows/columns may come in various permutations. I usually need to semi-...
11
votes
1answer
131 views

Display bug in Dataset's UnitConvert handling

Bug introduced in 11.0.1 or earlier and fixed in 11.1.0 Is this yet another annoying regression in v11 Dataset type handling? The display form seems to be a ...
11
votes
1answer
388 views

Getting data from FRED

Mathematica V10.4 supports a service for connection to FRED. If you create a connection with fred = ServiceConnect["FederalReserveEconomicData"] (you need to ...
11
votes
1answer
182 views

Odd StringTake problem in Dataset

Bug introduced in 10.0 and fixed in 10.4 Dataset is new in 10.0 10.2 Win64 Works fine... ...
11
votes
1answer
134 views

Dataset interferes with SeedRandom

Bug introduced in 11.0.1 or earlier and fixed in 11.1 This seems like a pretty awful bug: SeedRandom[1]; RandomInteger[10, 10] Out: {1,4,0,7,0,0,8,6,0,4} While:...
10
votes
2answers
632 views

Unexpected behavior when using SortBy as a dataset filter

I am still experimenting with datasets. Recently I tried to query the Titanic example to get info on the oldest passengers. Here is what I tried ...
10
votes
2answers
406 views

Why can I not replace a Dataset using a rule?

Simple replacement of a Dataset object does not seem to follow the expected behavior... Dataset[{}] /. _Dataset->1 Returns the empty Dataset not 1 as I would ...
10
votes
2answers
266 views

Does Dataset round? [duplicate]

I'm importing the following Excel file: My code and its results are: ...
10
votes
2answers
749 views

Creating a Stock Dataset

I've been looking into how to create a stock database in Mathematica using Dataset. This may or may not be a sensible idea, depending on the quantity of data required, although the possibility of ...
10
votes
1answer
1k views

Converting structured data to a dataset [duplicate]

A Dataset seems perfect to represent structured data. Has anyone already thought about how to convert as efficiently/elegantly as possible an XML or JSON file to a Dataset in Mathematica 10 ?
10
votes
1answer
248 views

Dataset function and related gadgets not ideal for large datasets

There's a performance bottleneck when using these types of functions. If I had a large CSV file and were to import it as a regular 'unstructured' CSV, I save almost half the time importing the file, ...
10
votes
2answers
214 views

Using Merge[Identity] and Transpose on a Dataset

While experimenting with this answer, I ran across the following: ...
10
votes
1answer
193 views

Problems with Dataset's querying on a fresh Kernel

Bug introduced in V10.4.1 or earlier and fixed in V11.3 A support case with the identification [CASE:3710757] [...] I checked and reproduced the issue at my end and have reported the issue to our ...
10
votes
1answer
3k views

Converting a Table to a Dataset

I feel like this is a simple task, and there may be a built in method to doing this (but I can't find it if there is). I would like to be able to take a table and convert it into a structured Dataset. ...
10
votes
1answer
168 views

Using MapIndexed[List] on a dataset fails — why?

The following works: MapIndexed[List]@{1, 2, 3} (* {{1, {1}}, {2, {2}}, {3, {3}}} *) This works too: ...
10
votes
0answers
774 views

Dataset in Mathematica 10.0.1

Wolfram pages "Mathematica Quick Revision History" in Mathematica 10.0.1 release says: "New operators and compositions of operators enabled for associations functions such as Dataset and Query" ...
9
votes
4answers
215 views

Dataset query for keys of upper levels

Say I have a Dataset like this: dat=Dataset[<|"a" -> 2, "b" -> "y", "c" -> {2, 3}|>] I want to get the keys of upper levels as elements in the ...
9
votes
3answers
1k views

How to pass options to ListPlot when using a DataSet?

Still learning the new DataSet feature, I would like to create a ListPlot where the color of the points is to be determined by a ...
9
votes
2answers
897 views

How to read .npy file in Mathematica?

I have a .npy file which is created by numpy of Python as below:- ...
9
votes
3answers
2k views

Converting datasets to nested lists

Imagine the Shipments relation: ...
9
votes
3answers
241 views

Parsing Org-Mode Timelog Data

Suppose we have in ~/time-data/time-data.org the following data: ...
9
votes
3answers
297 views

Problem constructing Association tables with some operators

fixed in 10.0.2 First, set up the example Dataset from the documentation: titanic = ExampleData[{"Dataset", "Titanic"}]; Why ...
9
votes
1answer
290 views

Why is Dataset upset by division by zero?

Consider this example: ...
9
votes
3answers
319 views

Applying functions to some columns in a Dataset and keeping only those

Take the following example Dataset: data = Table[Association["a" -> i, "b" -> i^2, "c" -> i^3], {i, 4}] // Dataset ...
9
votes
2answers
269 views

How to insert zero counts uniformly with Dataset Counts query

Missing[] is generated when an association does not contain the specified key. ...
9
votes
1answer
210 views

Dataset - append row with a value which depends on two other rows

I have go through the forum but did not see this question. Hope I don't miss it. I want to add a new colum "C" to a dataset with existing columns named "A" and "B". The value of "C" shall be the ...

1
2
3 4 5
12