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

learn more… | top users | synonyms

0
votes
1answer
38 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
112 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
44 views
0
votes
1answer
39 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
131 views

JoinAcross on nested association by nested key

I would like to join two associations on nested keys. Is this possible? ...
2
votes
1answer
49 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
41 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
171 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
121 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 ...
15
votes
1answer
154 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
122 views

A shortened association

...
3
votes
4answers
207 views

How to switch from List of rules to Association?

Considering we have a list of rules: ...
0
votes
0answers
40 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
87 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
44 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
96 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
44 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
66 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
70 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
495 views

How to search Dataset to find all keys share same Value

If I have the following Dataset ...
4
votes
0answers
62 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
196 views

Change Values in Dataset under Condition

I have the following Dataset: ...
7
votes
1answer
112 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
105 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
98 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
95 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
113 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
67 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
49 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
106 views

Select From List of Nested Associations

I have an association: ...
5
votes
4answers
148 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
95 views

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

I would like to transform a table like ...
5
votes
1answer
111 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
72 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
51 views

How to make Association reflect new assignments

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

Using ListPlot and lists of Associations

I have a list of associations : ...
6
votes
1answer
175 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: ...
2
votes
2answers
64 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
78 views

Bug in ExportString with Associations as ExpressionML?

bug present as of 10.1.0 If I try to export this toy code as ExpressionML or just XML: ...
7
votes
2answers
290 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/ ...
15
votes
2answers
285 views

Difference between Association and Dispatch

In the example below, Association has a different behavior from Dispatch: ...
3
votes
3answers
117 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
83 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
33 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
106 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
289 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
201 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 ...
11
votes
1answer
246 views

BUG: AssociationMap loses definition

I'm facing a strange behavior of AssociationMap. With a fresh Kernel session: ...
0
votes
0answers
50 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: ...