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

learn more… | top users | synonyms

0
votes
0answers
32 views

Reducing quantile & color map queries for use with Associations

This set of queries perform basic maps to quantile and then color-map. There's got to be a more compact solution. What are some approaches to reduction? Numeric: ...
0
votes
1answer
32 views

How to extract an association with similar keys from another association?

Considering we have an association like: ...
2
votes
1answer
49 views

Manipulating unevaluated expressions in nested function calls

This is a follow-up to my earlier question: Passing an unevaluated part of an association to a function I'm trying to create a modular dashboard that controls sound volume of an audio system ...
10
votes
2answers
297 views

Is there an idiomatic way to determine whether an `Association` is a subset of another?

I would like a way to tell if every key-value pair of an Association is contained in another. For instance, ...
10
votes
1answer
79 views

Problem with Clear[assoc] as a value in an Association

According to the documentation, in order to make sure that a value in an association is not evaluated at initialization, one can use a RuleDelayed. This works fine: ...
6
votes
2answers
96 views

Passing an unevaluated part of an association to a function

I'm making a UI widget that controls sound volume on a speaker using a slider, e.g.: ...
9
votes
1answer
105 views

Union on Associations (Kernel Kill)

Bug introduced in 10.1 and fixed in 10.2.0 Perhaps Union on Associations is not being encouraged since ...
13
votes
4answers
184 views

Association's Key[key] extraction different in V10.1/V10.2

V10.1: <|a -> 1|>[Key @ a] (* Missing["KeyAbsent", Key[a]]*) V10.0: <|a -> 1|>[Key @ a] (* 1 *) Bug or ...
9
votes
0answers
79 views

Strange result of DeleteCases in an association

The function DeleteCases can be used for associations, also with level specification. Here is an example where some values are associations: ...
0
votes
0answers
13 views

Comparing association using MatchQ [duplicate]

For me below query results into False.I expect it to return True. ...
4
votes
2answers
66 views

How to delete blank valued keys from nested association?

Considering we have: acs = <|"A" -> <|"a" -> " ", "aa" -> "asd"|>, "B" -> <|"bb" -> " "|>|> How can we come to have a result ...
6
votes
1answer
118 views

Is there a practical way to define a default value for missing keys in an Association?

It can be very useful to define background or default value for an object that can be incremented or otherwise modified. A simple (and for me, common) use is a counter: ...
22
votes
2answers
292 views

Dataset vs an association of associations

Associations with a record structure (e.g., a flat table) can be organised in one of two main ways. First as a list of associations, which is also used in the case of Mathematica's data set ...
2
votes
1answer
59 views

Quotes vs No Quotes for Association Keys

I've tended to not put quotes around the names of my Key when making Associations. For example: ...
5
votes
4answers
160 views

Create Nested List from tabular data

Im trying to create a nested list from tabular data, then onward into a nested association. I can get part way with the help of this answer but it only works for the first level. Repeated use of this ...
2
votes
3answers
91 views

How to check keys and values in nested Associations?

Considering we have a an association: ...
10
votes
3answers
167 views

Association of Associations : how to permute level 1 and level 2 keys?

I have a ragged Association of Association, say : ...
4
votes
3answers
95 views

Change value associated with keys using alternatives

I have a List of Associations that contains a Key called "ClaimBasis". There are about 10 possible values that ClaimBasis can take on, one of them being the value Null. I want all values that are ...
2
votes
1answer
83 views

Memory usage optimization for a large Association/SparseArray

Reformulating my question in simpler terms. Take two lists list1 = RandomInteger[{1, 100000000}, 25000000]; list2 = RandomReal[{1, 10}, 25000000]; Make an ...
4
votes
3answers
89 views

Extract all Values from nested Association

Considering we have an Association: ...
1
vote
1answer
82 views

Arrangement Order and Multiple Columns Sorting Order of Associations with Missing Keys

I have the following well-formed JSON string ...
0
votes
1answer
126 views

ParallelTable slower than Table in the presence of an Association?

So after testing some things I am completely reformulating my problem. First an example ...
10
votes
2answers
128 views

Lookup with default broken in Dataset

Given an Association, ...
3
votes
3answers
74 views

Orderless storage of tabulated function values

I would like to elaborate on my previous question Function of arguments given in non-fixed order and a relevant related one Best practice of passing a large number of parameters to functions I find ...
4
votes
1answer
93 views

when two associations are equal?

<|a -> 2, b -> 3|> == <|b -> 3, a -> 2|> returns False; can anybody explain why? If I am not mistaken ...
6
votes
2answers
177 views

Transpose can't handle fractions

Bug introduced in 10.0 and fixed in 10.2.0 Note: Dataset and Association are new in 10.0 Related to this question, why can't ...
4
votes
0answers
73 views

Why is Transpose Dataset slow in one direction

Transpose is faster when it distributes Keys at the 2nd level of a Dataset than when it factors them out. ...
1
vote
2answers
83 views

Import nested JSON file [duplicate]

For a project where I receive JSON messages from a web server I was trying to convert these messages into a format that can be used easily within Mathematica. Because JSON also consists of key-value ...
3
votes
0answers
54 views

Applying functions to irregularly distributed Keys in Association lists

This Q is related to this one, but now refer to the situation as irregularly distributed Keys in lists of Associations: ...
0
votes
1answer
50 views

How to loop in a nested Association?

Considering we have an Association: ...
3
votes
1answer
60 views

How to combine keys in nested list of rules or associations?

Considering we have a list of rules: ...
0
votes
1answer
57 views

How to extract info from Association? [duplicate]

How can one extract a list of keys and a list of values from the association? e.g. as = <|a->1, b->2, c->3, d->4|> ...
7
votes
1answer
135 views

Find and return the key with lowest value in association list

I am still new in Mathematica, and I need some help here. Suppose that I have an association ...
0
votes
1answer
48 views
0
votes
1answer
50 views

How to switch keys in a Map to Association [closed]

I have an association that has parameters for a function. These parameters represent two cases that need to be applied to the function. Some parameter values are common to both cases but some are ...
8
votes
2answers
161 views

JoinAcross on nested association by nested key

I would like to join two associations on nested keys. Is this possible? ...
2
votes
1answer
57 views

Can association be used to find the maximum key less than a specific number?

Suppose we have an association assoc. assoc = <| 1 -> 1, 3 -> 2, 5 -> 3, 7 -> 4, 20 -> 5|>; Instead of ...
4
votes
0answers
47 views

Wrong autogenerated package from notebook containing #key and Part as subscript

Bug introduced in 10.0.0 and persisting through 10.1.0 or later Mathematica v10.1.0, under Windows 8.1 x64 Mathematica v10.0.2, under Windows 1) Define a function in an initialization cell: ...
5
votes
2answers
194 views

Create a list of rules built from data set fields

I want to convert a dataset to a list of features and a list of target values, for use in Predict and also more generally. I know ...
4
votes
3answers
147 views

How to map over inner keys of nested Associations?

Considering an association: <|"a" -> <|aa-> "asc", bb-> "asd", cc-> 0, ImageType -> "asd", dd-> "asd"|>|> How can I make the inner ...
17
votes
1answer
193 views

Why do lookup times in Dataset and Association differ by orders of magnitude?

Consider the following three data structures: a list of rules, an association, and a dataset: ...
1
vote
2answers
129 views

A shortened association

...
6
votes
5answers
319 views

How to switch from List of rules to Association? [duplicate]

Considering we have a list of rules: ...
0
votes
0answers
41 views

Is association in mathematica ordered or not? [duplicate]

Does the association <|a -> 1, b -> 2, c -> 3|> in Mathematica have order or not? If I iterate the association multiple times, is it guaranteed that ...
4
votes
1answer
107 views

Ordered associations

Mathematica 10 has introduced Associations, elsewhere known as hash tables or dictionaries. Is there Ordered equivalent like in Python, Java, .NET? The data structure should remember the order in ...
2
votes
0answers
48 views

Does Mathematica support out-of-core Associations?

I often find myself collecting data in an Association[] which outgrows my computer's main memory. Does Mathematica support any out-of-core equivalent? Ideally, I ...
1
vote
3answers
98 views

MapThread (or alternative) for adding fixed option

I currently use MapThread[f, {{a1, a2}, {b1, b2}] for obtaining { f[a1, b1], f[a2, b2] }. Is there a version (or alternative) ...
0
votes
2answers
69 views

Extract data pairs from a list of associations?

I am starting to use the new Associations, so this maybe an easy question, but I haven't figured it out. I have a list of associations, like: ...
2
votes
1answer
76 views

ParallelMap doesn't work with an Association. Is this a bug?

I receive a ParallelCombine::nopar1 error when executing ParallelMap[Identity, <|1 -> 1, 2 -> 2|>] Is this an ...
2
votes
0answers
78 views

How to convert a notebook to an association and back?

I have a notebook that serves as a nice readable document but is it a database of sorts, I'd like to transform this into an association so I can manipulate and export it as a dataset. Here is a sample ...