Questions tagged [grouping]

The process of grouping entities into collections of associated elements.

0
votes
0answers
7 views

using ngx-pipes groupBy with nested object

I have an object like this: { "data": { "cart": { "id": "d754932d-45e2-448f-baeb-b457aafd5ee3-47751", "orderItem": [ { "id": ...
0
votes
1answer
10 views

How to separate groups of lanes in ggplot2 geom_point?

I am plotting data from a data.frame which is structured like this: A B C D 29.8 8.7 0.1 Type_1 The first three columns are floats and the last is a string. ...
1
vote
2answers
36 views

Count Variable by Subgroup and Over Time

I am working with panel data. Specifically, I am dealing with data that is structured for duration analysis. I am looking at when a U.S. state adopts a policy. I have around 500 different policies, ...
0
votes
0answers
17 views

Creating new columns based off rankings of groups in Pandas [duplicate]

I have a Pandas Data frame that shows the top games played by players in descending order: Out[7]: customer_id game total_plays 0 15 Numbers 2 1 15 ...
0
votes
1answer
15 views

Grouping and extraction unique items based on columns in dataframes?

I have a dataframe as follows: mydata: Id, date X1, 2015,01 X2, 2015,02 X2, 2015,02 X3, 2015,03 X3, 2015,03 X4, 2015,03 X4, 2015,03 X5, 2015,05 X6, 2015,05 X7, 2015,05 From this dataframe, I want ...
0
votes
0answers
51 views

How Collectors.groupingBy and Collectors.partitioningBy work in jdk8 internally?

What is the internal structure and how does it work groupingBy and partitioningBy internally in Java 8. FYI: I know what is use of Collectors.groupingBy and Collectors.partitioningBy. Let's consider ...
0
votes
2answers
45 views

How to Group and Sort Objects in ObjectListView?

I am trying to group my list of objects in an ObjectListView. The ObjectListView should group the objects based on the first column but then have that same column sorted based on a custom sort. How ...
0
votes
1answer
36 views

Grouping pyspark dataframe by intersection [duplicate]

I need to group PySpark dataframe by intersection of arrays in column. For example from dataframe like this: v1 | [1, 2, 3] v2 | [4, 5] v3 | [1, 7] result should be: [v1, v3] | [1, 2, 3, 7] [v2] | [...
4
votes
2answers
58 views

Calculate relative change in time by group

I am struggeling to calculate the percent difference between the annual net sales for a company, with taken into account NA's. Here's an sample of the data: dt <- data.table(lpermno = c(10065, ...
0
votes
0answers
26 views

Postgres - Extract latest record from historical data for each entity that meets specific criteria

I have an asset_history table that looks like this... asset_id | timestamp | sites | 1 2019-02-02 09:10:01 null 1 2019-02-02 09:10:...
1
vote
2answers
23 views

Filtering Before Groupingby / Summarize in Powerbi

I am having some troubles in grouping and filtering in powerbi. I want to be clear about the question so, my goal is to make everything on DAX and not using the filters in the reports. I am doing this ...
0
votes
1answer
22 views

Looking to see if I misunderstand the numberformatter or whether I am using it incorrectly for parsing and validation

Trying to use the Numberformatter to parse and validate user input for integers (formatter type = DECIMAL). Perhaps it is academic, but I want to be able to change the grouping separator be different ...
0
votes
2answers
38 views

group and count in python

I am trying to get group by and count in python. It does not seem to group for some reason Using python 2.7 #!/usr/bin/env python counts = {} logfile = open("/tmp/test.out", "r") for line in ...
1
vote
2answers
24 views

Put results into a group of 2, or any number I specify

I need a way to put results into # of groups that I specify. I have tried ntile() function, which I thought would use but it's not working: WITH CTE AS ( SELECT 1 as Number UNION ALL SELECT ...
0
votes
1answer
52 views

Find most active or most recent userid by machineid

I have a table with MachineID, UserID and Date columns. Each day I insert/append into this table a record of which user logs onto which machine, so I end up with a daily historical log of users ...
-1
votes
1answer
42 views

Finding max value in a list of list

I am looking for an elegant way to take a list of lists and find the max value for a subset of elements. It is better explained with a small example. Given the following input: data = [['1','AAA','...
1
vote
1answer
27 views

Pandas Group 2-D NumPy Data by Range of Values

I have a large data set in the form of a 2D array. The 2D array represents continuous intensity data and I want to use this to create another 2D array of the same size only this time, the values are ...
-2
votes
1answer
63 views

Grouping records and counting within groups

I have API data in JSON format. { "players": [{ "player_full_name": "ghny", "url": "...", }] } I need to group all records by division and get the count of players. ...
0
votes
0answers
16 views

Tracking specific category of job listings - Google Analytics

I have only just started using Google Analytics. I am using it on a jobs board and I am interested in tracking traffic on a specific category of job listings. I have found a way on how to track ...
0
votes
1answer
17 views

Preserve formatting of ColumnCalculations while downloading pdf from tabulator

Issue: While downloading through tabulator all the column formatting is removed. I am aware of using accessors to reformat the data before downloading. This way I can define formatting for individual ...
-2
votes
3answers
38 views

List of objects, Need advice on how to organize them

I have a list of objects that looks like the below example: [ {time: 68, value: 300, metric: "tubingPressure"}, {time: 69, value: 300, metric: "tubingPressure"}, {time: 70, value: 361.81, ...
1
vote
2answers
33 views

Group and Sum Multiple Columns without Pandas

I have a list that contains multiple columns, and I need to group and sum rows based on two columns. Can I do this without using a Pandas dataframe? I have a dataset in a list like this: User Days ...
0
votes
0answers
19 views

Algorithm for grouping coordinate points into groups of N size while keeping the relative distance between any 2 points in a group minimal [closed]

Let's say I have an array of length L. This array contains points with X and Y coordinates on a finite grid. I want to group these points into even groups of N size. I also want these groups to be ...
0
votes
0answers
20 views

How to get the first non-NULL values of each group in DolphinDB

I am using DolphinDB and would like to get the first non-NULL value of each group. I used select first(x), avg(y) from t group by symbol but looks like their function 'first' gets the first value ...
1
vote
1answer
48 views

Issues with using CollectionViewSource for grouping on a datagrid

I have been trying to group data within my datagrid for a while now with no luck. In my ViewModel the properties: public ObservableCollection<CompetitorModel> Competitors { get; } = ...
0
votes
1answer
27 views

Can I group Multiple stored procedures based on Column in brand new proc ? to avoid duplicate results?

The goal is to get one results out of those three stored procedures by grouping them by Id to avoid duplication! I am having three stored procedure , they returns same tables with different results ...
0
votes
0answers
13 views

How to create personalized Groups in windows explorer

I understand that windows allows grouping Files/folders based on criteria such as Name, Date, Type, Size, as well as over 200 additional suggestions under the More.. selection of the Group By drop ...
1
vote
7answers
56 views

How to group list by values?

Let's say I have a list like this: [['John', 1], ['Fred', 1], ['Carolyn', 1], ['Kenneth', 3], ['Ronald', 3], ['Dorothy', 2], ['Joyce', 2], ['Julia', 3], ['Deborah', 1], ['Jonathan', 2], ['Aaron', 2], ...
1
vote
0answers
30 views

Grouping/clustering algorithms with uncertain distance metrics

I need some guidance on how to improve a clustering algorithm. The answer may be trivial, or impossible. I googled a lot, but I either don't understand the analogy between my problem and known ...
1
vote
1answer
42 views

Grouping similar strings together from a list

I've been struggling this morning with a problem at the office. I need to find a way to group strings together from a list. It's hard to explain so here's an example: Let's say I have a list as ...
-6
votes
0answers
47 views

How to group rows in a RDD to find maximum value in a group

I am new to Spark & using SPARK Shell with SCALA. I am trying to work on an assignment but got stuck. Need help! I have the (Movielens) dataset stored in HDFS. The dataset is semi colon separated....
0
votes
1answer
27 views

Grouping different column into one row

How to make one row in different rows and column SELECT internal_id, store_id, user_id, shift_info, DATE(log_datetime) dates, (case when log_action = '0' then TIME(log_datetime) end)...
0
votes
2answers
27 views

Add a different value (by groups) to another value in dataframe in R

I have two dataframes, I want to subtract the value of column in one dataframe to another, if dataframes are equal in value of another column. I have two dataframes A and B that are similar to the ...
0
votes
1answer
20 views

Group distinct names with many entries as single string SQL Server

I have 1 table called BSFolks that contains: Name Number ---- ------ Sam Jackson BS001 Sam Jackson BS003 Sam Jackson null Miley Cyrus BS666 Miley Cyrus BS069 Miley Cyrus BS013 C....
2
votes
2answers
74 views

Mutate a column in data.table with ifelse and group by

I have some dplyr code I'm moving to data.table, this is a problem I just ran into. I want the difference from one row to the next in b stored in column c if a is greater or equal than 3. However ...
0
votes
1answer
15 views

How do I add calculated value as a group in a pie chart using SSRS?

I'm trying to understand how to plot data to a pie chart using calculations versus grouping. I've tried series and category grouping: =Switch(Left(Trim(Fields!WaybillNumber.Value),2) = "SA", "SA", ...
0
votes
1answer
31 views

WPF C# Display ICollectionView Groupings Only

I have an ICollectionView with a GroupDescriptions applied. I would like to display the group in the ListView and NOT display the members of the group. I would also like to use a property from the ...
-1
votes
2answers
33 views

Give index on data

Hope you can help me with my problem. I would like to create an index on each group in my data. The data looks like this. ID X 1 1 1 2 1 1 1 2 1 1 1 2 1 3 2 1 2 2 2 3 2 4 2 1 2 2 2 3 2 1 2 2 I ...
1
vote
1answer
56 views

Is it possible to use stat_function by group?

Following with the answer to my previous question, let's say that I am plotting density curves by group with ggplot and I want to produce the corresponding normal curve for each group (with their ...
0
votes
1answer
15 views

Only keep rows per each value in one column BEFORE (time-based) a certain condition is fulfilled in another column

I have a table of orders, numerated by order_id. Other relevant columns include customer_id, timestamp, and Condition_column. For each customer_id, I want to only keep the rows BEFORE (aka timestamp&...
1
vote
1answer
24 views

Group by similarity of string on a single table

I need your help in writing a Oracle SQL query for below requirement. Source data as below: CLAIM_NUMBER ADDRESS_1 ADDRESS_2 1001 220 CHIRAG ST OHIO 1003 ...
0
votes
2answers
53 views

Swift: Assignment group number to member of Tuple in array of Tuples

I have some array of Tuples with definition like this: [(description: [String], criterion: Int, relative: Double, average: Int, type: String, group: Int)] and sorted by decrease of .criterion. I ...
0
votes
1answer
36 views

how to calculate the mean of an array using grouping variables in python?

I would like to calculate the mean of an array in python, using different grouping variables. For instance, I want to calculate the mean of all values in column1, for which column2 == 2 and column3 == ...
0
votes
1answer
46 views

Recoding a categorical variable

I am unable to group in larger "categories" from existent ones in the variables "Text_General_Code". I tried to process the "Text_General_Code" stand alone. It gave me more than eight variables in my ...
1
vote
1answer
40 views

Perl regex for multiple pattern grouping and multiline regex

I have a input txt file containing multiple number of lines in the mentioned format. JMOD_01 :: This is starting of grouping 2nd KFGJHFG RTIRT DFB SFJKF ERIEFF FJDKF OIOIISD SDJKD last line ...
1
vote
0answers
22 views

Use case for uniq, groupby without sorting

While debugging a Python programme, I recently discovered that the Python itertools#groupby() function requires the input collection to be sorted, because it only groups identical elements that occur ...
1
vote
1answer
17 views

Oracle grouping occurring more than once

I need a solution on the following Group Begindate enddate a1 1/1/2019 2/1/2019 a1 2/1/2019 3/1/2019 a2 3/1/2019 3/2/2019 a2 3/2/2019 3/4/2019 a1 3/4/2019 ...
1
vote
1answer
56 views

combinatoric grouping optimization problem based on time interval overlap, weight constraint, and distance minimization

Let each element be an individual. Consider that an individual is defined such that each individual has a time range, weight, and location. The goal is to group together individuals whose time ranges ...
0
votes
0answers
10 views

Can HystrixCommand information be grouped by command group in hystrix dashboard?

I'm testing Hystrix Dashboard with my apps and I would like to have separate sections for each command group key. Is this a feature of the dashboard? I couldn't find any documentation about such a ...
0
votes
0answers
29 views

How to give multiple conditions in $group in mongodb [duplicate]

I have to show the inspection count based upon the condition, if the user have edit inspection option then they can see the both published and unpublished file. If user don't have edit inspection then ...