Questions on the associative data-structure introduced in Mathematica version 10.

learn more… | top users | synonyms

13
votes
7answers
433 views

How to search Dataset to find all keys share same Value

If I have the following Dataset ...
4
votes
0answers
46 views

What is Association[Rule[“ID”,number ] and how it is used

I am trying to understand the structure and the use of Dataset and I came across something new to me. First check this example: ...
12
votes
2answers
145 views

Change Values in Dataset under Condition

I have the following Dataset: ...
7
votes
1answer
78 views

How can I export `Dataset` to a standard format?

I work with big data on AWS and scientific data in all the standard formats such as these... Is there any way to Import/Export Datasets or Associations to any of these non-primitive (txt, csv, ...
4
votes
2answers
100 views

Can I sum or mulitply 2 columns in a list of associations

I have a list of associations. I will need to add 2 columns (or perform some other arithmetic operation) and put the answer in a new column. For example: ...
3
votes
1answer
91 views

Given a list made up of subsets of an alphabet, how can I use associations to create a Boolean dictionary of the given list

I have a list of 30,000 elements, each of the element is a list in itself {{a, b}, {p, q, r}, {a, p}, ..., {z, x}}. Second one contains unique elements ...
7
votes
1answer
88 views

Assigning new value in association

I experienced a problem in changing values in an association and broke down the problem to the following: Given a list of association (here with one element): ...
2
votes
2answers
103 views

KeyMap on a flat Dataset (i.e. Dataset@Association)

How can I go from Dataset[<|"A" -> 1, "B" -> 2, "C" -> 3|>] to ...
3
votes
1answer
63 views

Converting path list to the nested list

I'm trying to convert the plain path list to the nested tree list like the following codes. ...
0
votes
0answers
44 views

Strange behavior of AssociationMap

here is what I've searched over stackexchange I'm on windows 8.1 x64 with Mathema... 10.0.2. sometimes, Definition[AssociationMap ]=Null I found ...
7
votes
1answer
93 views

Select From List of Nested Associations

I have an association: ...
5
votes
4answers
142 views

Functional way to Climb an Association Decision Tree

Associations are nice tool to create decision trees. Here is a toy example of how I'm starting to use it: ...
3
votes
1answer
65 views

Transform a table (list of associations) to a flat association

I would like to transform a table like ...
5
votes
1answer
102 views

Select query with named slot lookups?

Given this Dataset fragment (copy-paste friendly version at bottom) Can this query be simplified by referencing named slots directly in the ...
1
vote
0answers
62 views

Speed up replacement using Rule Dispatch Associtation

I knew that this has asked many times, but I hope there is something more could be done to speed this up. The expression kappa is here. ...
4
votes
1answer
47 views

How to make Association reflect new assignments

How do I get Association to act like List in the following? ...
2
votes
2answers
74 views

Using ListPlot and lists of Associations

I have a list of associations : ...
6
votes
1answer
169 views

10.0.2 breaks a recursive “trie” query

10.0.2 Dataset type system complication breaks a recursive trie constructor that worked in 0.1: ...
1
vote
2answers
62 views

Association without an associated value

Sometimes, we only need to store the keys which will be checked whether certain keys exist in the data structure(corresponding data structures in C++ are std::set ...
4
votes
0answers
61 views

Bug in ExportString with Associations as ExpressionML?

If I try to export this toy code as ExpressionML or just XML: ...
7
votes
2answers
270 views

10.0.2 another Dataset type system (inference?) warning

Bug introduced in 10.0.2 The warning below seems unrelated to these issues: Did 10.0.2 break some forms for named slots? and 10.0.2 mapping Association to Dataset warning. First noticed w/ ...
14
votes
2answers
270 views

Difference between Association and Dispatch

In the example below, Association has a different behavior from Dispatch: ...
3
votes
3answers
114 views

ReplacePart equivalent for Associations

I have a fairly complicated Association. I wish to use/create a function such as ReplacePart to operate on certain Keys within this multi-level Association. Here's ...
4
votes
1answer
67 views

Filtering Query Nested Data (Dataset and Association)

I am trying to filter a nested Dataset. I have some data that looks like this (curated for this example): ...
0
votes
0answers
31 views

Parallel assigning to an Association

This is a simplified example of a problem I ran into. I want to count how often a subkernel executes a given computation. So, after having launched the subkernels, I construct an association with ...
7
votes
1answer
102 views

about the design of Part related to Association

<|"a" -> 1, "b" -> 2, "c" -> 3, "d" -> 4|>[[1]] gives values 1 while ...
12
votes
1answer
270 views

10.0.2 mapping Association to Dataset warning

In 10.0.2 ExampleData[{"Dataset", "Titanic"}][All, <| "gender" -> #sex|> &] Outputs the expected result, but also throws: MapAt::partw: Part ...
7
votes
1answer
192 views

Did 10.0.2 break some forms for named slots?

Since 10.0.2 some code that previously worked using named slots fail in very particular circumstances. Attchd screenshot shows the issue w/ a particular Dataset ...
8
votes
1answer
191 views

BUG: AssociationMap loses definition

I'm facing a strange behavior of AssociationMap. With a fresh Kernel session: ...
0
votes
0answers
47 views

Could It get more efficient way (fastest)?

Before Mathematica 10, If I need something like a Map, dictionary I used to make something like: ...
4
votes
1answer
74 views

How can Map be given access to the keys of a Dataset?

Consider an example Dataset: ...
10
votes
3answers
167 views

How can a key be renamed in an Association?

Consider an example Association: assoc = <|"a" -> 1, "b" -> "x", "this_key_is_too_long_to_type" -> {1}|>; ...
8
votes
4answers
211 views

How can a field be efficiently added to a Dataset?

Let's use the example Dataset: ...
11
votes
2answers
159 views

Listable functions thread over Associations; is this documented?

Thanks to a somewhat misapplied use of MapThread I learned of this behavior: ...
7
votes
3answers
136 views

How does MapThread work with Associations

According to the documentation, MapThread works on Association objects. But it doesn't seem to evaluate the passed function. For ...
2
votes
0answers
45 views

Automating constructor definitions (OptionValue eval time)? [duplicate]

I'm settling in on a programming pattern for "constructors." I can illustrate the pattern with the following example, which defines a constructor newBar for ...
15
votes
0answers
136 views

A bug in the overloading of MemberQ and FreeQ for Association?

Bug introduced in 10.0.0 While answering Pattern match for nested Association I came across behavior of MemberQ and FreeQ in ...
4
votes
3answers
120 views

Pattern match for nested Association

Suppose I have Association testAssoc=Association[a->Association[1->1,2->2],b->Association[1->1,2->2]] which ...
0
votes
1answer
64 views

Association of pure functions [duplicate]

I've encountered confusing behavior of Association when I try to use it for storing pure functions. For example: as = <|"1" -> # + 1 &|> ...
6
votes
3answers
213 views

GroupBy a list of associations with their keys

How can I go from ...
4
votes
3answers
88 views

Save associations to a file and reload

I have many (say 2 for now) associations that I want to save to a file ...
4
votes
1answer
99 views

Casting Dataset internal type from Assoc to Struct

Using: planets = ExampleData[{"Dataset", "Planets"}]; The full form of this projection displays the internal type def: ...
1
vote
0answers
80 views

Bug? Side effects when exporting to .mx

I seem to have encountered a bug when exporting to .mx, at least on OS X. Can anyone reproduce this? I am on MMA 10, OS X 10.9.4. ...
6
votes
1answer
101 views

Held keys in associations

Jacob Akkerboom commented: Note that PositionIndex does work correctly with held expressions, whereas this is a bit painful to implement using ...
8
votes
0answers
647 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" ...
11
votes
5answers
287 views

Applying a function to a Dataset column conditional on another slot's value

How to apply a function to a column conditional on another slot's value? The Dataset documentation show only how to apply a function to named slots independently. The ...
5
votes
1answer
132 views

Mapping over an association producing an unexpected result

The documentation for associations says that the keys of an association are transparent for many operations. Map is one such operation. However, I am confronted ...
1
vote
0answers
45 views

How to pattern match an association? [duplicate]

I have the following: Clear[a, b]; a = {{1, 2, 3}, {4, 2, 5}, {6, 7, 8}}; b = GroupBy[a, #[[2]] &]; b whose output is: ...
6
votes
2answers
135 views

DeleteMissing level spec confusion

Given: titanic = ExampleData[{"Dataset", "Titanic"}] Why does this correctly delete Missing[] elements: ...