52
votes
Dataset vs an association of associations
A Dataset represents an abstraction over a structured collection of data. Notionally, it is restricted to "well-behaved" data -- data that comes in simple forms ...
32
votes
Accepted
28
votes
Accepted
Assign names to Dataset columns
data = N @ Normalize[#, Total] & @ Counts @ Characters @ ExampleData[
{"Text", "DeclarationOfIndependence"}
];
Dataset @ data
...

Kuba♦
- 135k
27
votes
Difference between HashTable datastructure and Association datastructure
Summary
Important differences between Association and CreateDataStructure["HashTable"] include:
associations are ...
24
votes
Accepted
What's the difference between these 2 associations?
Preamble
The real problem here seems somewhat deeper than what the (mostly correct) observations in comments indicate. In Mathematica, a number of objects, which are so-called raw objects (including ...
22
votes
22
votes
Accepted
Count works differently depending on how an association was created
As Kirill Belov notes in a comment, the issue is related to the fact that the list a1 is a packed array (generated by Range) ...
21
votes
Assign names to Dataset columns
Actully we have a easiest way,suppose you have dataset like
...
21
votes
Accepted
Is it possible to avoid unpacking when merging Association?
One can use TracePrint to see how Flatten is being used by Merge:
...
19
votes
How to switch from List of rules to Association?
The undocumented function ToAssociations in the GeneralUtilities package does this
...
19
votes
Reverse Lookup: getting keys from values
One way would be to "invert" the association and then look up values in the result:
...
19
votes
Bug with Block & Lookup: Scope Variable Leak
Looks like a bug to me as well. Just as Michael I would suspect that the problem is more with Lookup than Block or ...
18
votes
Accepted
Why do lookup times in Dataset and Association differ by orders of magnitude?
As @Mr.Wizard notes in a comment, some discussion about the overheads associated with querying can be found in another question (56609).
This response will use Mathematica version 10.1.0 to examine ...
18
votes
Merge function performing too slowly; what can be done about it?
It appears GroupBy does not suffer from this performance issue, so here is an alternative implementation using it, compared to ...
17
votes
Accepted
Pattern matching to a function evaluation inside an Association
Association is HoldAllComplete. Once it is created, its parts will then normally be held unevaluated. Use ...
16
votes
Accepted
Association of Associations : how to permute level 1 and level 2 keys?
Mathematica 10.1 almost supports this operation directly:
...
16
votes
How to organically merge nested associations?
Update
Created an upsert function to update/insert new keys and values into a nested association structure. It automatically inserts nested associations where they ...
16
votes
Accepted
How to "flatten" a nested Association?
Another idea:
FixedPoint[Association[Normal[#] /. Rule[n_, m_Association] :>
KeyMap[Append[n, #] &, m]] &, KeyMap[{#} &, asso]]
<...
16
votes
Accepted
Convert List of Associations into Association of Lists
You can use the undocumented AllowedHeads option of Transpose to do this:
...
16
votes
Substitute for Association inside Compile?
For what it's worth, you can work with a HashTable as long as you're willing to put in a bit of effort
...
16
votes
Accepted
Evaluated vs. unevaluated Association
Summary
The confusion we observe here is largely due to ambiguous use of the symbol Association as an expression head. On the one hand, ...
15
votes
Accepted
Reshaping associations, generalization of GroupBy
One approach is to employ a helper function that unwraps singleton lists:
{delist[v_]} ^:= v
With this, the GroupBy ...
15
votes
Accepted
15
votes
Accepted
Merge function performing too slowly; what can be done about it?
This would seem to really be a question on runtime complexity of Merge, or more specifically in this case Merge[Total]. It seems ...
14
votes
Extract all Values from nested Association
Given
asso = <|a -> tr, b -> <|c -> <|d -> 12, e -> del|>|>, f -> g|>
then directly
...
14
votes
Accepted
Transpose fail in 11.1 Dataset
As observed in the question, the problem lies with the type information of the dataset. Specifically, the type information for the innermost association is missing (i.e. "any type"). This causes the ...
14
votes
Move the outer key inward in an association
Here's an approach using @@@ (Apply at level {1}):
...
13
votes
Accepted
How to switch from List of rules to Association?
Not pretty but works:
lst //. x : {__Rule} :> Association[x]

Kuba♦
- 135k
13
votes
Accepted
Find and return the key with lowest value in association list
Use:
Keys @ MinimalBy[Value]@ A
{1, "2", 10, 12, 16}
About your approach, you can add ...

Kuba♦
- 135k
13
votes
Accepted
How to mimic thing["property"] syntax?
How can I recreate this sort of functionality with my own objects and functions? Are there any methodologies for writing down-values of symbols like this?
If you want to know how to get a similar ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
associations × 550dataset × 118
list-manipulation × 107
bugs × 39
performance-tuning × 32
pattern-matching × 28
query × 28
filtering × 27
data-structures × 24
replacement × 23
evaluation × 20
map × 20
rule × 16
function-construction × 14
hold × 14
functions × 12
syntax × 12
core-language × 12
data × 11
matrix × 10
import × 10
expression-manipulation × 10
gathering × 10
plotting × 9
programming × 9