Skip to main content

Questions tagged [query]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
138 views

How to extract elements from a Table?

I have a time series table of three players ...
RPlotter's user avatar
2 votes
2 answers
116 views

Write an expression that queries all of MMA to find the top M Symbols with the most Options or M Symbols having N Options?

I apologize, but I'm way over my pay-grade on this one, so I don't have any code to share that needs correcting. That is because I really don't know how to start this. I feel like this has a very easy ...
Jules Manson's user avatar
  • 2,467
4 votes
1 answer
162 views

Apply TimeSeries onto one or more Dataset Columns

I recently responded to a question on Wolfram Community. My solution works, but I believe it could be improved. I'm trying to apply a TimeSeries to one or more ...
david's user avatar
  • 1,457
0 votes
0 answers
53 views

How to search exact product title with ServiceExecute

I am trying to find the exact product title having phrase "HEPA filter bags" on "amazon.com" but it doesn't return the correct result. ...
Anh's user avatar
  • 125
4 votes
1 answer
80 views

How can default valued be added in a Query?

I'm not understanding the the default values are not used to produced a length of 0 in the following example. What is the right way to add default values during a query? ...
Alan's user avatar
  • 13.8k
0 votes
0 answers
39 views

How to specify authenticity of SSL for querying APIs?

While ago I was using this command with no issue, now I have an SSL error: ...
user305883's user avatar
4 votes
2 answers
176 views

Select dataset rows that meet a mathematical criterion in a column

Here is a simple dataset: ...
Rob's user avatar
  • 141
9 votes
1 answer
276 views

Generating Google BigQuery API Access Token in Wolfram Language

I'm working on a Wolfram Language Package to connect into Google Bigquery (that I'll make public available). In order to finish It, I need to solve a last step, that is how to get an authentication ...
Murta's user avatar
  • 26.4k
4 votes
2 answers
201 views

Using subquery in Query of Dataset

I want to create a Query to a Dataset that will select a subset of three columns, modify the date column in this subset (to month), group by month and a second column (location), take the group means ...
George Ellis's user avatar
5 votes
1 answer
178 views

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

...
PaulCommentary's user avatar
2 votes
0 answers
58 views

Is there a documented meaning for the following Query syntax?

Consider this example: ...
Szabolcs's user avatar
  • 236k
3 votes
0 answers
159 views

Efficiently get positions of Query results

I have some very large Datasets. Is there any efficient method of getting the positions of results found in a Query? That is, without using ...
user5601's user avatar
  • 3,790
4 votes
1 answer
131 views

A simple way to extract information from this dataset with Query?

I have a dataset comparable to the following (you may wrap it in Dataset if you like). I am looking for a relatively simple way to query it and extract information. ...
Szabolcs's user avatar
  • 236k
0 votes
0 answers
32 views

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: ...
user13892's user avatar
  • 9,751
1 vote
1 answer
89 views

A more efficient way to interrogate data inside a Dataset: a generic relational map

I have a Dataset that stores the relationships between people IDs (in columns) and the events they attended (in rows). I want to produce a linear text report of those relationships. How can I do this ...
berrynice's user avatar
  • 163
13 votes
2 answers
351 views

Does anyone know a way to use patterns in Query?

This question is a follow up from my previous question. Query has a nice syntax that allows it to apply functions on association based on specific ...
user13892's user avatar
  • 9,751
3 votes
3 answers
2k views

Select specific rows of a dataset

I am struggling with extracting specific rows from a dataset. ...
Coffee_09's user avatar
  • 197
8 votes
2 answers
285 views

How does Query decide the order in which the functions are applied?

First of all I know that Query is a nice way to organize your functions that are applying at specific levels of an expression. But I don't understand the order in ...
user13892's user avatar
  • 9,751
0 votes
1 answer
200 views

Using Semantic Import to do an Excel-like VLookUp using Mathematica

I'm following an example provided in the following Stack Exchange Link but, using a different approach. My data is contained in an Excel workbook called "Input Workbook.xlsx" as shown here: I ...
Gilmar Rodriguez Pierluissi's user avatar
0 votes
1 answer
128 views

What is the analog of Query in python? [closed]

Is there an analog of Query[] in Python 3.8+?
user5601's user avatar
  • 3,790
4 votes
1 answer
109 views

Inconsistency in getting Keys, Values and Query for nested Rules

Querying nested Rule expressions of the form a -> v -> b // FullForm Rule[a,Rule[v,b]] for ...
alancalvitti's user avatar
  • 15.2k
5 votes
2 answers
134 views

How to pull out the underlying query syntax being used by dataset?

Consider the following dataset. titanic = ExampleData[{"Dataset", "Titanic"}] If I use the lookup syntax of the dataset like following it creates an equivalent <...
user13892's user avatar
  • 9,751
8 votes
2 answers
191 views

Query inside Dynamic triggers continuous high CPU load for FE

Here is a (vicious) problem I am able to reproduce with v12 and v11.3 (previous versions not tested) and OSX. This is a minimal example to demonstrate it (even if it seems useless here I do need <...
SquareOne's user avatar
  • 7,625
1 vote
0 answers
56 views

How do I Select when the key of an association is a multi-word string [closed]

I have imported some survey responses into a Dataset. I now want to select those rows where the response to "participant type" == "Virtual". I discovered that this ...
Andy Burnett's user avatar
4 votes
2 answers
127 views

Simple dataset query

Why does taking a Part fail in a Dataset query function when there is an operation in the index argument? ...
Simon Rochester's user avatar
2 votes
1 answer
184 views

Replacing values in a dataset

Could someone explain why ...
Fortsaint's user avatar
  • 2,060
0 votes
1 answer
198 views

Aggregate function problem

I use a function to do something similar to a SQL sum. I've asked about simplifying it in another post. I'm still using this function and it works well for aggregates like ...
Mitchell Kaplan's user avatar
5 votes
1 answer
98 views

Operator form for Histogram of multiple datasets?

I would like to plot a histogram for multiple datasets in a dataset query, but can't quite seem to make it work in operator notation: ...
M.R.'s user avatar
  • 31.8k
2 votes
0 answers
43 views

Keyed eigensystem for nested Association

Suppose a matrix is given where both rows and columns are keyed, for example this correlation matrix: ...
alancalvitti's user avatar
  • 15.2k
2 votes
1 answer
90 views

Handling Missing values flexibly in Query (MissingBehavior problem)

There’s an inconsistency in how Missing values are imputed in Query, with ...
alancalvitti's user avatar
  • 15.2k
6 votes
1 answer
340 views

How to filter this nested list of Association

For example, I have the following data ...
matheorem's user avatar
  • 17.4k
3 votes
1 answer
199 views

Query from Association of Associations Dataset

I have a rather large dataset comprised of Association of Associations. For better or worse, I've converted this into a Dataset. Here is a simplified version of ...
kale's user avatar
  • 11k
7 votes
3 answers
410 views

Applying a function by Key pattern, preserving Association order

Any convenient ways to apply a function to Keys that match a pattern in an Association? Method should handle: Mixture of ...
alancalvitti's user avatar
  • 15.2k
8 votes
1 answer
92 views

Unexpected behavior of PreIncrement when querying associations

For reasons I won't go into here, I became curious about the what would happen should I make a query that applies PreIncrement to one key in a list of associations....
m_goldberg's user avatar
  • 108k
4 votes
0 answers
116 views

How to get parent key in Query on Association/Dataset?

Is there a general and terse method to obtain the parent key of the current "position" in a Query of an Association/...
Edmund's user avatar
  • 43.2k
4 votes
2 answers
40 views

How to Quiet an operator to avoid Query fail

This Query fail, due to divide by zero error message... <|"a" -> 1, "b" -> 0|> // Query[#a/#b &] Missing["Failed"] ...can be prevented by ...
alancalvitti's user avatar
  • 15.2k
8 votes
1 answer
463 views

Transpose fail in 11.1 Dataset

The type system underlying Dataset seems a total kludge, as soon as one issue is fixed, here it recurs in a slightly different form - and difficult to isolate in minimal examples. Here's a failure ...
alancalvitti's user avatar
  • 15.2k
3 votes
1 answer
94 views

Dataset type system fail with composite keys and Infinity

In 11.1, a Dataset consisting of an Association with composite keys with an Infinity causes failure in keying-in: ...
alancalvitti's user avatar
  • 15.2k
9 votes
2 answers
216 views

Getting slices of a nested Association via Query

I'd like to get specific slices from a nested database-like Association through Query. Take for example this toy database of ...
Sascha's user avatar
  • 8,529
3 votes
2 answers
153 views

Composition with Transpose failure with Dataset

Is the failure of the 2nd Transpose here a known bug? Dataset[{{0, 10}, {2, 11}, {3, 12}}][ Transpose /* Map[MinMax] /* Transpose] // Normal ...
alancalvitti's user avatar
  • 15.2k
11 votes
2 answers
285 views

Simplifying a reverse Fold for a Query

Is there a simpler way to parametrize this tail-recursive expression to be applied as a Query (for processing a nested ...
alancalvitti's user avatar
  • 15.2k
9 votes
2 answers
268 views

Slicing an Association with named key span without normalizing?

Is there way to slice an Association with named key span? Span currently doesn't accept named keys: ...
alancalvitti's user avatar
  • 15.2k
22 votes
2 answers
403 views

Query: adding additional operator changes meaning of preceding operators

Consider the following query: Range[5] // Query[Select[EvenQ] /* Append[1], f] (* {f[2], f[4], 1} *) It selects the even numbers, applies ...
WReach's user avatar
  • 69.3k
3 votes
0 answers
71 views

Aligning input form of a sequence of Queries

Is there a way to modify the parser, or define options, to align the indentation of a sequence of Queries on a Dataset? Given: ds = <|"a" -> 1, "b" -> <|"c" -> 2|>, "d" -> <|"e" -> 3, "f" ...
alancalvitti's user avatar
  • 15.2k
12 votes
0 answers
181 views

Unix-like reference to parent and root Association?

Is there a syntax or function to reference parent and root when querying nested Associations similar to Unix' ".." and "/", eg "cd ../../mydir". ? Here's a typical application of the root construct....
alancalvitti's user avatar
  • 15.2k
2 votes
1 answer
386 views

Query and Dataset Syntax Peculiarities

Question Can someone please explain to me the syntax of Query and why its behavior is so befuddling to me at the moment? I am going to go through a few simple ...
SumNeuron's user avatar
  • 5,442
11 votes
2 answers
220 views

Large Dataset query fails if column contains Missing

In version 11.0 (Win 8.1 Pro) a query on a large Dataset for a column that contains Missing fails most unceremoniously. With <...
Edmund's user avatar
  • 43.2k
4 votes
1 answer
194 views

Passing values from a list to Select during a Dataset query

Given a Dataset: ...
Mumen Raida's user avatar
6 votes
0 answers
146 views

Parallelize Dataset Query: What is the best way to change Query "compilation"?

As per Mathematica Query documentation: Before being applied, Query expressions are "compiled" into ordinary compositions of ordinary Wolfram Language functions and their operator forms. To ...
Lukas Lang's user avatar
  • 34.4k
6 votes
1 answer
120 views

Mapping (Query) a function at multiple locations in nested data via All, Span

For this data: dt = <|"a"-> <|"x"-> 1|>,"b"-> <|"y"-> 2|>,"c"-> <|"z"->3|>|> It’s awkward when mapping the same ...
alancalvitti's user avatar
  • 15.2k