Questions tagged [associations]

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

Filter by
Sorted by
Tagged with
3
votes
2answers
140 views

Side-effecting an array in an association?

I'm working on some classical data structures (stack, queue, etc.) and want to mimic oo style in MMA. As a first attempt, I want to store an array in an Association, like this: ...
2
votes
0answers
94 views

Adding an unused column creates an error in JoinAcross

I'd been having trouble using JoinAcross on two datasets. After going through the answers to my original question and fixing my code, I find I'm now having a ...
9
votes
0answers
309 views

Dataset: cannot reproduce a basic example. A bug? [duplicate]

Just to report: I try to reproduce the very first example for the Dataset from the Documentation Center: ...
14
votes
1answer
376 views

Benefit of using Dataset to collect SQLSelect output

Considering a DatabaseExample included with Mathematica: ...
9
votes
2answers
257 views

How to insert zero counts uniformly with Dataset Counts query

Missing[] is generated when an association does not contain the specified key. ...
1
vote
1answer
136 views

How can I append associations with uneven elements? [duplicate]

My dataset is pretty simple so far: ...
9
votes
1answer
605 views

Key->Value or Value when returning (multiple) parts of an Association

There seems to be an idiom whereby multiple parts generates Key->Value forms whereas for single part specifications, only a Value is returned. This however, can lead to inconsistencies as follows: <...
19
votes
1answer
755 views

Learning Resources for Data Science in the Wolfram Language

I'm delivering an upcoming course on Data Science with the programming/analysis done predominantly in the Wolfram Language. I created the following table to leverage students' familiarity with Lists ...
1
vote
1answer
211 views

why head Association cannot be replaced by head List [duplicate]

Consider replacing head of List by head Association: {a -> x, b -> y, c -> z} /. List -> Association (*<|a -> x, b -> y, c -> z|>*) ...
7
votes
1answer
720 views

Is there a faster way to Map an Association?

Consider mapping an existing Association in a manner such as this: ...
7
votes
3answers
480 views

AssociationMap to query Dataset across levels?

Is there a way to operate on Dataset across levels to apply a function f to a key -> value pair in an Association as follows: ...
19
votes
3answers
2k views

Converting hierarchies of rules to associations

The impossibility of MatchQ-ing inside and Association MatchQ-ing Associations (MMA 10) explains a problem I have. I would like ...
20
votes
2answers
696 views

MatchQ-ing Associations (MMA 10)

Consider {x->1} which has FullForm List[Rule[x, 1]] and, therefore, ...
50
votes
3answers
4k views

Changing Values in an Association using Map

I am trying to change the value of one key in an association based on the value of another key in that association. So if my association starts as: ...
4
votes
1answer
645 views

Using Datasets in Mathematica 10.0

Bug introduced in 10.0 and fixed in 10.1 I am trying to use the Dataset functionality which was introduced in Mathematica 10.0 : ...
3
votes
0answers
271 views

Combining key pivoting and lookup operators in Dataset

This question is related to this one re pivoting on keys. Because of the nesting, using Leonid's method as starting point - single key: ...
7
votes
3answers
941 views

Normal // Association // Dataset workaround for some user query operators

Given example tabular data (ie, with rows and columns, or "data frames") ...
16
votes
3answers
828 views

Equivalent of ReplaceAll for Associations?

Is there a nice (built-in) way to apply Replace-style rules to key-value pairs in an association? Something like ...
6
votes
1answer
379 views

MapAt and generic Functions on Associations and Datasets

These are distinct but related questions about mapping functions to Associations and Datasets. Given: assoc = <| a -> 1, b -> 2, c -> 3|> And <...
145
votes
3answers
10k views

How to make use of Associations?

I have been curious about it for long. Now that Mathematica 10 arrives, I think it's time to ask the question: How the new Association data structure would be used ...
61
votes
6answers
9k views

How can I add a column into a existing Dataset?

I'm very excited about the brand new Dataset function. I have played with it in Wolfram Cloud, and haven't figured out how can I add a new column into an existing <...