Questions tagged [query]

71 questions
25
votes
1 answer

Struggling to understand Query

The documentation for Query starts with: data = { <|"a" -> 1, "b" -> "x", "c" -> {1}|>, <|"a" -> 2, "b" -> "y", "c" -> {2, 3}|>, <|"a" -> 3, "b" -> "z", "c" -> {3}|>, <|"a" -> 4, "b" -> "x", "c" -> {4, 5}|>, <|"a" -> 5, "b" -> "y",…
Mitchell Kaplan
  • 3,696
  • 22
  • 34
7
votes
2 answers

Nothing in a Query

In Mathematica 10, Nothing is defined as to automaticaly disappear when used in a list or in an association, and moreover with the property that it returns Nothing when called with any number of arguments. Consider the following Query: (Query[f][{1,…
Fred Simons
  • 10,181
  • 18
  • 49
5
votes
1 answer

How can I understand this example of Query taken from current Mathematica documentation?

Query[All, <|"A" -> "a", "B" -> "b", "C" -> "c"|>] @ { <|"a" -> 1, "b" -> "x", "c" -> {1}|>, <|"a" -> 2, "b" -> "y", "c" -> {2, 3}|>, <|"a" -> 3, "b" -> "z", "c" -> {3}|>, <|"a" -> 4, "b" -> "x", "c" -> {4, 5}|>, <|"a" -> 5, "b" -> "y",…
PaulCommentary
  • 1,482
  • 7
  • 12
0
votes
0 answers

Can the following operation be performed in a single query without using explicit Maps or nesting Queries?

Is there a way to include the function StringPosition["e"] inside the Query in the following: query=Query[ Histogram[Flatten@#]&, All, First ]@*StringPosition["e"] There are three functions in use here Histogram[Flatten@#]&, First and…
user13892
  • 9,375
  • 1
  • 13
  • 41