Questions tagged [group-by]

0 votes
1 replies
A better way to group and count multiple columns SQL
I have a survey table that shows the answers that people have taken once a month when they enter a contest. I'm trying to find a better way to...
asked 4 months ago
0 votes
1 replies
Ansible group by a json attribute
I've the below json data. { "images": [ { "id": "79334504-3e48-4411-b602-afe920e32e14", "name": "rhel-7-fac...
asked 4 months ago
1 votes
2 replies
How to define a python lambda getting the first element?
import pandas as pd df = pd.DataFrame({'A': [0, 0, 1, 1], 'B': [1, 3, 8, 10], 'C': ['alpha', 'bravo', 'ch...
asked 4 months ago
0 votes
0 replies
Creating Grouped Dataframe with dplyr
I have a dataframe that was put together from 6 other data frames using dplyr's "bind_rows" command. This worked nicely in terms of merging the c...
asked 4 months ago
2 votes
0 replies
purrr split %>% map %>% bind VERSUS dplyr group_by %>% do
I am often in the position of wanting to split-apply-combine regression models. I've found two ways of doing it, the "purrr" approach and the "dp...
0 votes
0 replies
How to split data in groups and apply filter [duplicate]
I have the Yelp dataset and I want to count all reviews which have greater than 3 stars. I get the count of reviews by doing this: reviews.group...
-2 votes
1 replies
Grouping Python List of Objects
I have a list of Python Objects of type class Service. I would like to group this list according to one of the data members of this class class...
asked 4 months ago
3 votes
2 replies
How to get D1 D7 D30 without left join on the same table
Objective: I would like to know everyone who signed up on Day 0, how many of them logged in after D1, after D7 and after D30. I would like to ma...
0 votes
1 replies
Reverse group by and counts
I have tables for questions and answers. Each question can have 0 or multiple answers. When you left join the tables you get something like this:...
0 votes
1 replies
ggplot2 grouping data by the first word of the row name and assigning a color pallet to each group
I have the following dataframe, cafe: cafe_type X Y bread - white 354 1 bread - wheat 674 3 bread - rye 756 4 bread - sourdough 234 2...
asked 4 months ago
1 votes
2 replies
what are aggregated columns in mysql?
What are aggregated columns and non-aggregated columns? I have read the MySQL Handling of GROUP BY and am confused. I do not know what 'aggregate...
asked 4 months ago
1 votes
1 replies
Pandas / Python - How to view all the rows or records of a group by object?
I have code such as, x.groupby(x['interval_start_time'])['acceptance_rate'].apply(lambda x: np.percentile(x, [5,10,25,50,75,90,95]).round(2))...
asked 4 months ago
0 votes
0 replies
How to combine duplicate rows into a Single Row unique Identifiers
How do I combine duplicate rows with different values using unique identifiers. I've created the created SQL Query but limited knowledge in SQL...
asked 4 months ago
-1 votes
1 replies
convert DataFrameGroupBy into data frame so that I can get individual columns
I have a data set following columns: Country Gdp Life Satisfaction I want to group on country and GDP. I want GDP col in a list...
asked 4 months ago
-1 votes
2 replies
MYSQL - Use Group By with Order By with Joins
Currently, I am having a query as below to get the counts based on the groups as below, But I having an issue with doing order by with group by w...
asked 4 months ago
2 votes
1 replies
Using Linq to GroupBy and Case When via datatable
enter code hereI have a Datatable like this: LN Test_Code Name Test_Item_Code Test_Data 0107001 A0...
asked 4 months ago
0 votes
2 replies
SQL How to add multiple attributes to group by function
I am using Oracle SQL ad want to write a query that will display the customer(s) details that referred the maximum number of customers. There can...
asked 4 months ago
-4 votes
2 replies
How to group array of objects by value [duplicate]
This question already has an answer here: group array of objects by property first letter...
asked 4 months ago
0 votes
1 replies
How do I sum values between a date and that same date plus 12 weeks?
I have data at the Cust_ID and Week_Date level with sales_dollars. Each Week_Date represents the sales_dollars for that week. I want to sum the d...
asked 4 months ago
3 votes
3 replies
Oracle SQL Conditional SUM
I have a table of names and numeric values and I want to sum values grouped by names. This part is simple: SELECT name, SUM(my_v...
asked 4 months ago
1 votes
0 replies
Return the values of a column, associated with the values returned by “summarise”, used on another column
I have a function which summarises the first best values for abs column. abs5_fun <- function(x) { ... buysell <- group_by_at(buysell,...
asked 4 months ago
1 votes
1 replies
How to use custom function in dplyr group_by
I'm trying to use a custom function (which returns a scalar) in summarise or mutate in a dplyr flow which includes a group_by. The function works...
asked 4 months ago
0 votes
2 replies
Query a validation within another and bring the filtered data PostgreSql
I need to group all the results of an external table and only return the users that do not have the completed status I have the following query....
asked 4 months ago
1 votes
1 replies
R - Select IDs only if some conditions are met per group
I am trying to build a recommender that will recommend the right people for a specific activity based on the skills people have. To do so, I firs...
asked 4 months ago
2 votes
1 replies
GroupByWithSumPipe to sort a list and sum an attribute of grouped items Angular
I use a GroupBy pipe to group my data according to a parameter and it works very well, but I would like to add to this pipe a second parameter li...