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

learn more… | top users | synonyms

0
votes
0answers
12 views

Comparing association using MatchQ [duplicate]

For me below query results into False.I expect it to return True. ...
1
vote
2answers
44 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
91 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: ...
16
votes
2answers
156 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 ...
1
vote
1answer
54 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
148 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
85 views

How to check keys and values in nested Associations?

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

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

I have a ragged Association of Association, say : ...
4
votes
3answers
94 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
73 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
86 views

Extract all Values from nested Association

Considering we have an Association: ...
1
vote
1answer
77 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
119 views

Lookup with default broken in Dataset

Given an Association, ...
3
votes
3answers
68 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
90 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 ...
4
votes
2answers
142 views

Transpose can't handle fractions

Related to this question, why can't Transpose handle fractions? (Note the doc pages for Transpose hasn't been updated for v10) ...
4
votes
0answers
63 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
72 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
51 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
44 views

How to loop in a nested Association?

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

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

Considering we have a list of rules: ...
0
votes
1answer
54 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
129 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
47 views
0
votes
1answer
47 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
160 views

JoinAcross on nested association by nested key

I would like to join two associations on nested keys. Is this possible? ...
2
votes
1answer
55 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
45 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
188 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
143 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
189 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
126 views

A shortened association

...
6
votes
5answers
311 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
97 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
46 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
60 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: ...
1
vote
1answer
70 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
73 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 ...
14
votes
7answers
535 views

How to search Dataset to find all keys share same Value

If I have the following Dataset ...
4
votes
0answers
70 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: ...
13
votes
2answers
261 views

Change Values in Dataset under Condition

I have the following Dataset: ...
7
votes
1answer
142 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
115 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
114 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
107 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
125 views

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

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