Questions tagged [grouping]

The process of grouping entities into collections of associated elements.

Grouping is a form of hierarchical knowledge representation, similar to mind mapping, concept mapping and argument mapping, all of which need to observe at least some of the principles of grouping.

SQL Server - Indicates whether a specified column expression in a GROUP BY list is aggregated or not. Read more about this

Wiki Links

7381 questions
15
votes
4 answers

Group and average NumPy matrix

Say I have an arbitrary numpy matrix that looks like this: arr = [[ 6.0 12.0 1.0] [ 7.0 9.0 1.0] [ 8.0 7.0 1.0] [ 4.0 3.0 2.0] [ 6.0 1.0 2.0] [ 2.0 5.0 2.0] [ 9.0 4.0 3.0] …
Algorithm
  • 199
  • 1
  • 8
15
votes
2 answers

Groups of nodes with the same attributes in GraphViz file

In the dot language of GraphViz I want to describe a 2-mode network. So I have nodes of two different types. One group for example could contains people how read and the other group could contain the books being read by the people. I want to give…
halloleo
  • 9,216
  • 13
  • 64
  • 122
15
votes
4 answers

Group and count by month

I have a booking table and I want to get number of bookings in a month i.e. group by month. And I am confused that how to get month from a date. Here is my schema: { "_id" : ObjectId("5485dd6af4708669af35ffe6"), "bookingid" : 1, …
user1584253
  • 975
  • 2
  • 18
  • 55
15
votes
2 answers

Using ddply to apply a function to a group of rows

I use ddply quite a bit but I do not consider myself an expert. I have a data frame (df) with grouping variable "Group" which has values of "A", "B" and "C" and the variable to summarize, "Var" has numeric values. If I use ddply(df, .(Group),…
Joseph Kreke
  • 667
  • 1
  • 7
  • 18
15
votes
1 answer

What's the difference between Organizations & Groups in CKAN?

What are Groups? You can use CKAN Groups to create and manage collections of datasets. This could be to catalogue datasets for a particular project or team, or on a particular theme, or as a very simple way to help people find and search…
Techie
  • 44,706
  • 42
  • 157
  • 243
15
votes
1 answer

Grouping records in JasperReports

I have a problem with JasperReports. I want to group the records depending on one specific column's value. For example input…
viet thang
  • 161
  • 1
  • 3
  • 8
14
votes
6 answers

How to count the consecutive duplicate values in an array?

I have an array like this: $arr = array(1, 1, 1, 2, 2, 3, 3, 1, 1, 2, 2, 3); I found the function array_count_values(), but it will group all of the same values and count the occurrences without respecting breaks in the consecutive…
Jeg Bagus
  • 4,895
  • 9
  • 43
  • 54
14
votes
8 answers

How to group or merge this array of objects in javascript?

I have an array of objects like below for example. {name: "Mc Donald", quantity: 4, maleCount: 1, femaleCount: 0} {name: "KFC", quantity: 9, maleCount: 1, femaleCount: 0} {name: "KFC", quantity: 9, maleCount: 1, femaleCount: 0} {name: "Mc…
the newbie coder
  • 652
  • 2
  • 8
  • 27
14
votes
7 answers

How to group array of objects by date in swift?

Need to group according to date. Response coming is in sorted format. Need to apply a filter on date to group. Response coming from backend: [ { "date": "date1" }, { "date": "date1" }, { "date": "date1" }, …
Sahil Jaidka
  • 271
  • 1
  • 5
  • 13
14
votes
1 answer

Python Pandas sorting after groupby and aggregate

I am trying to sort data (Pandas) after grouping and aggregating and I am stuck. My data: data = {'from_year': [2010, 2011, 2012, 2011, 2012, 2010, 2011, 2012], 'name': ['John', 'John1', 'John', 'John', 'John4', 'John', 'John1', 'John6'], …
Tomas Rasymas
  • 145
  • 1
  • 1
  • 6
14
votes
2 answers

How to do range grouping on a column using dplyr?

I want to group a data.table based on a column's range value, how can I do this with the dplyr library? For example, my data table is like below: library(data.table) library(dplyr) DT <- data.table(A=1:100, B=runif(100), Amount=runif(100, 0,…
Carter
  • 1,563
  • 8
  • 23
  • 32
14
votes
2 answers

Sort and Group in LINQ

I have a list of string tuples, say (P1,P2) I'd like to know if there's a LINQ statement where I could group by P1 (in ascending order), and have that group contain all the P2 values for the group (in descending order). For input: ("A","B"),…
Jono
  • 1,964
  • 4
  • 18
  • 35
14
votes
5 answers

Why .NET group by is (much) slower when the number of buckets grows

Given this simple piece of code and 10mln array of random numbers: static int Main(string[] args) { int size = 10000000; int num = 10; //increase num to reduce number of buckets int numOfBuckets = size/num; int[]…
rank1
  • 1,018
  • 4
  • 16
  • 37
14
votes
19 answers

Custom array_chunk to prioritize filling columns as much as possible

I have an array which can have several items in it, e.g: Item 1 Item 2 Item 3 Item 4 Item 5 Item 6 etc I need the quickest way to restructure this array so that it has at most X items. So if I say that X is 3, the resulting array must be: Item 1 ,…
rockstardev
  • 13,479
  • 39
  • 164
  • 296
14
votes
1 answer

Regression and summary statistics by group within a data.table

I would like to calculate some summary statistics and perform different regressions by group within a data table, and have the results in "wide" format (i.e. one row per group with several columns). I can do it in multiple steps, but it seems like…
dnlbrky
  • 9,396
  • 2
  • 51
  • 64