aggregate Questions

6

Solved

I have a table of data with the following fields EventID : Int, AutoIncrement, Primary Key EventType : Int ' Defines what happened EventTimeStamp : DateTime ' When the Event Happened UserID : Int ...
Glad asked 12/12, 2010 at 17:8

2

as stated in the title i'm having some problems querying from MongoDB Compass using the aggregate methhod. I have a collection of documents in this form: {"Array":[{"field":"val","field2":"val2"},...
Scalade asked 8/6, 2018 at 8:5

18

Solved

I want to pass the numpy percentile() function through pandas' agg() function as I do below with various other numpy statistics functions. Right now I have a dataframe that looks like this: AGGREGA...
Georgianngeorgianna asked 10/7, 2013 at 18:22

7

Solved

I'm trying to do some aggregations on a pandas data frame. Here is a sample code: import pandas as pd df = pd.DataFrame({"User": ["user1", "user2", "user2", "user3", "user2", "user1"], "Amount":...
Arminius asked 19/6, 2017 at 16:28

6

I have a dataframe: pe_odds[ [ 'EVENT_ID', 'SELECTION_ID', 'ODDS' ] ] Out[67]: EVENT_ID SELECTION_ID ODDS 0 100429300 5297529 18.00 1 100429300 5297529 20.00 2 100429300 5297529 21.00 3 10042930...
Recurrent asked 12/10, 2014 at 10:1

3

Solved

I want to ask if there is a plan or exists a method to aggregate the return(s) of an IAsyncEnumerable? So given the below method why is there no terse way to aggregate its result? public async IAs...
Pipsqueak asked 25/2, 2020 at 10:37

1

Solved

In the following code, struct B is an aggregate with base struct A, and B-object is aggregate initialized B b{ A{} }: #include <iostream> struct A { A() { std::cout << "A ";...
Inigo asked 28/1, 2022 at 18:25

19

Solved

I have a data frame with two columns. First column contains categories such as "First", "Second", "Third", and the second column has numbers that represent the number of times I saw the specific gr...
Nightgown asked 2/11, 2009 at 9:1

4

Solved

I'm using aggregate to get the count of a column of booleans. I want the number of True values. DJANGO CODE: count = Model.objects.filter(id=pk).aggregate(bool_col=Count('my_bool_col') This ret...
Littles asked 11/8, 2014 at 19:0

2

Solved

In C++ I have this struct from C. This code is very old and cannot be modified: struct Point { double coord[3]; }; On the other hand, I have this modern function which returns modern std::array i...
Tetramethyldiarsine asked 19/12, 2023 at 8:56

4

Solved

Lets say I have a small integer array like this: {10,20,30} Now for the items of that array I want to apply the following formula: 10^(arrayLenght-1) + 20^{arrayLenght-2) + 30^{arrayLenght-3} ...
Tight asked 23/8, 2013 at 11:54

2

Solved

I'm trying to implement a procedure to evaluate the median absolute deviation of a set of numbers (usually obtained via a GROUP BY clause). An example of a query where I'd like to use this is: s...
Ormond asked 31/10, 2010 at 22:33

19

Solved

I have a dataframe and I would like to count the number of rows within each group. I reguarly use the aggregate function to sum data as follows: df2 <- aggregate(x ~ Year + Month, data = df1, s...
Hegumen asked 21/3, 2012 at 16:50

6

Solved

I have a data frame in R which has a lot of duplicate records. I am interested in finding out how many records of each are in this data frame. For example, I have this data frame: Fake Name Fak...
Michaelmas asked 10/7, 2018 at 19:11

6

Solved

Custom function to loop over a group in a dataframe. Here is some sample data: set.seed(42) tm <- as.numeric(c("1", "2", "3", "3", "2", "1&...
Mediation asked 15/7, 2015 at 13:9

4

Solved

have a table in vertica: test like this: ID | name 1 | AA 2 | AB 2 | AC 3 | AD 3 | AE 3 | AF how could I use an aggregate function or how to write a query to get data like this (vertica syntax)?...
Salutary asked 23/9, 2016 at 19:16

15

Solved

How can I do GroupBy multiple columns in LINQ Something similar to this in SQL: SELECT * FROM <TableName> GROUP BY <Column1>,<Column2> How can I convert this to LINQ: QuantityBre...
Syncretism asked 11/5, 2009 at 7:24

12

Solved

Say I have a data.frame object: df <- data.frame(name=c('black','black','black','red','red'), type=c('chair','chair','sofa','sofa','plate'), num=c(4,5,12,4,3)) Now I want to count the numbe...
Prot asked 16/9, 2011 at 21:33

3

I would like to know how can a domain event be implemented (in DDD) if it is not a natural result of an aggregate's state change. I will borrow the example of this post. So lets say that we need an...

5

Solved

Is there a pandas built-in way to apply two different aggregating functions f1, f2 to the same column df["returns"], without having to call agg() multiple times? Example dataframe: import...
Shiflett asked 25/9, 2012 at 19:5

4

Solved

I need a standard deviation function in SQLite. I have found one here: http://www.sqlite.org/contrib?orderby=date but its part of an extension file to SQLite. I've never installed one of these b...

6

Solved

I have a SQL Server 2008 query SELECT TOP 10 * FROM T WHERE ... ORDER BY ... I'd like to get also the total number of the rows. The obious way is to make a second query SELECT COUNT(*) FROM T W...
Daisey asked 4/3, 2009 at 14:58

2

Solved

I am creating an aggregate query, but I'm running into an issue with some of my fields that need to be converted to ObjectIDs'. There are certain documents that do not have anything in the fields(n...
Bingen asked 28/10, 2020 at 14:50

2

I want to order the array returned by json_arrayagg(). My query is similar to this:- select A, json_arrayagg(json_obj('X',value1, 'Y',value2)) AS RESULT FROM (derived table) GROUP BY A. What I wan...
Lothar asked 4/8, 2020 at 18:22

3

Solved

Consider the following dataframe: dummy_df <- tibble( A=c("ABC", "ABC", "BCD", "CDF", "CDF", "CDF"), B=c(0.25, 0.25, 1.23, 0.58, 0.5...
Aldoaldol asked 4/5, 2023 at 18:10

© 2022 - 2024 — McMap. All rights reserved.