Questions tagged [associations]
Questions on the associative data-structure introduced in Mathematica version 10.
608 questions
7
votes
3
answers
431
views
How to prevent Dataset from converting Pi to decimal point?
This might be another known issue in Dataset but not able to find workaround.
Dataset converts $\pi$ to decimal point. But keeps $\{\pi\}$ as exact.
Is there a way to tell Dataset to keep $\pi$ as ...
4
votes
2
answers
161
views
How to make Dataset display empty list as {} and not as blank?
I use Dataset to display Association. For debugging mainly. But if a field value is empty list {}, it display as blank. This can be confusing as it looks also same as if field was empty string.
Is ...
2
votes
0
answers
54
views
default key for associations [closed]
Suppose that I have an association like: a=<|1->2,2->3,3->5|>.
I want to modify a such that for every key not in {1,2,3}, for example 4, it returns -...
2
votes
0
answers
88
views
Is there any way to parallelize MapThread@AssociationThread?
Consider this code:
...
6
votes
2
answers
230
views
How can I force reevaluation of Association values? [duplicate]
After switching from 13.2 to 14.3, I noticed that some behavior of Association has changed:
...
4
votes
3
answers
395
views
Why does this Association show its Head, and how do I make it evaluate?
Evaluating
<|"key" -> {<|"key" -> "val"|>}|> /. {<|stuff__|>} :> <|stuff|>
Produces
...
1
vote
0
answers
81
views
Searchable non-atomic Associations
I really like Associations in most regards. But they can be really annoying to work with when you need to search, or act on, their value contents. I understand why ...
1
vote
2
answers
152
views
How to display only the keys of a nested association?
Main question:
Given some nested association assoc with an unknown structure (where the values are potentially rather large expressions and we do not want to ...
6
votes
3
answers
201
views
Associations in replacement rules variable
I have a large number of replacement rules where the right hand side (RHS) is always the same. To avoid repetition, I separated the two sides to add the same RHS to all of them.
This is a minimal ...
3
votes
2
answers
111
views
How do I use KeySort ignoring the first key-value pair?
How can I KeySort ignoring the first key-value pair?
e.g.:
from ...
1
vote
0
answers
150
views
Converting associations [closed]
I have a huge text file that has these associactions in it(one on each line):
{12, 14, 24, 25, 29}->{13, 22, 25, 31, 36}
I need to convert it to this form:
<...
4
votes
2
answers
222
views
ReplaceAll in Associations
I wish to apply some replacements in my association. For example, suppose I have
<|a->b,c-><|1->2,b->d|>|>
then, how to replace all ...
2
votes
1
answer
131
views
Searching a Tree with associations
My goal is to get association <|{"Yes",8}|->"likeCandy> by
arriving at leaf "likeCandy", from ...
6
votes
3
answers
384
views
How can I visualize OpenAPI JSON schemas in Mathematica?
Question
I’m working with an OpenAPI JSON schema and want to visualize and understand its structure using Mathematica. For example, given the following schema:
...
3
votes
2
answers
288
views
KeyDrop does not work with a Key that is a list
I want to use Counts with this kind of dataset:
assoc = Counts[{a, a, a, a, b, b, b, {c}, {c}}]
...