Questions tagged [aggregate]

Aggregate refers to the process of summarizing grouped data, commonly used in Statistics.

Aggregate refers to the process of summarizing grouped data, commonly used in Statistics. Typically this involves replacing groups of data with single values (e.g. sum, mean, standard deviation, etc.). In SQL databases and data manipulation libraries such as in , this is accomplished with the use of GROUP BY and aggregate functions.

Documentation:

8256 questions
2
votes
1 answer

How to keep other columns when using aggregate in R?

I have a dataframe, p4p5, that contains the following columns: p4p5 <- c("SampleID", "expr", "Gene", "Period", "Consequence", "isPTV") I've used the aggregate function here to find the median expression per Gene: p4p5_med <- aggregate(expr ~ Gene,…
claudiadast
  • 591
  • 3
  • 11
  • 33
2
votes
0 answers

Mongo DB , how select all documents in match query?

FOR getting all documents, what I write instead of XXXX. I want to get all values without a criterion. I must use aggregate and match function. payload.sla.customer.externalId variable is string. db.collection.aggregate ( [ { "$match" : { …
hasan p.
  • 43
  • 4
2
votes
2 answers

String mode aggregation with group by function

I have dataframe which looks like below Country City UK London USA Washington UK London UK Manchester USA Washington USA Chicago I want to group country and aggregate on the most repeated city in a country My…
Ahamed Moosa
  • 1,395
  • 7
  • 16
  • 30
2
votes
2 answers

How can I use aggregate sum with division?

I want to get average of the total within the past 3 months. I have an object called 'Book' and attribute 'total'. I need to sum up the total and divide by 3 to get the avg for one month. Here is my code: past_3_month_avg =…
user10683480
2
votes
1 answer

compare sum due date with current date by condional in aggregate mongodb?

I have some problem with aggregate, I have one collection.I have collection like code below. so on I have one field call dueDate compare with current Date 2018-11-16. I need sum remaining value by compare that current date with dueDate…
Aneat Tea
  • 95
  • 6
2
votes
2 answers

An efficient way of aggregating data from repeated measurements

I'm analyzing gene expression data from a large experiment (12400 single cells and 23800 genes) and I'm running into an efficiency problem. I will write a reproducible example below but my problem is the following: I converted mouse genes in my…
Atakan
  • 416
  • 3
  • 14
2
votes
1 answer

Filter rows with minimum values groupwise in Pandas dataframe

I just filtered some data and now I have a .csv file, but I just noticed that I need to select only the rows that have the minimun price: example: ORIGIN | DESTINA. | PRICE ____________________________ BOG | MAD | 1500 BOG | MAD …
rubio119
  • 191
  • 1
  • 2
  • 6
2
votes
1 answer

How to map multiple root types for aggregate relations in NHibernate?

Let's say I have a class Child which is contained in different other classes (ParentA and ParentB in this example). The following simple case demonstrates a simple model where ParentA and ParentB both contain a set of Child objects. public class…
Ron
  • 245
  • 3
  • 9
2
votes
1 answer

how to group by itemId sum qty with type bundle and parentId with type sale_order javascript?

Please help me with my collection i want sum qty the same itemId and type bundle, and with parentId with type Sale_Order like my collection below. `let item = [{ id: '001', name: 'A', qty: 10, type:'bundle' }, { …
Aneat Tea
  • 95
  • 6
2
votes
1 answer

mongodb | How to update(findandmodify) after aggregate

I want to update some of the values according to the result after query execution. What I want to +1 the "comment_sort" value if the condition is true. Condition : If "comment_group" is 1 and "comment_sort" is greater than 0 Original DataBase…
fly high
  • 215
  • 1
  • 4
  • 18
2
votes
3 answers

How to "union" overlapping range to non-overlapping range?

Question: Can anyone suggest a better or more pythonic approach, to reducing overlapping range pairs to non overlapping range pairs? Background: I have a list of tuples representing start and end pairs. I am trying to essentially complete a union of…
db_newb
  • 35
  • 5
2
votes
3 answers

Average of a column for the bottom N rows for each group in a table

I want to get the average of a column for the last 5 rows (if there are less than 5 rows (games) for a player then it should return nothing..) If I could use a subquery then it would be straight forward, but since this isn't supported Im not sure…
volting
  • 16,773
  • 7
  • 36
  • 54
2
votes
0 answers

MongoDb select many with a join on the result

I am trying to perform a join on a collection from the results of a select many using the MongoDb Linq driver pseudo code is from x in something from y in x.subcollection join a in detailed on y.id equals a.id select new { x.field, …
Tim Jarvis
  • 18,465
  • 9
  • 55
  • 92
2
votes
4 answers

Progress-4GL - What is the fastest way to summarize tables? (Aggregate Functions: Count, Sum etc.) - OpenEdge 10.2A

We are using OpenEdge 10.2A, and generating summary reports using progress procedures. We want to decrease the production time of the reports. Since using Accumulate and Accum functions are not really faster than defining variables to get summarized…
aza
  • 115
  • 13
2
votes
2 answers

Why Cassandra not support aggregation internally?

Considering this sentence in many books and articles: In a columnar architecture, queries that seek to aggregate the values of specific columns are optimized, because of all of the values to be aggregated exist within the same disk blocks. And…
Mohammad Akbari
  • 4,486
  • 6
  • 43
  • 74
1 2 3
99
100