Questions tagged [group]

585 questions
1
vote
0 answers

Is there a faster Python algorithm to iterate through grouped Cartesian product pairs?

I have two files (lhs and rhs), each with a grouping-variable field (other variables exist too). The goal is to iterate through the Cartesian product pairs within each grouping-variable value as quickly as possible. There may be grouping-variable…
Matt B
  • 11
  • 2
1
vote
1 answer

Add to set based on a prop

In the group stage I want to create a new array of colors, the colors are objects of two fields (name, value), the resulted array must contain colors with unique color names. { $group: { _id: null, sizes: { $addToSet:…
1
vote
1 answer

If I have a function that randomly creates shapes, how can I add those shapes to a group? (CMU CS Academy)

I'm working in CMU CS Academy's Sandbox and I currently have a function that will draw a rectangle of random size, color, and position: # List of colors app.colors = ['crimson', 'gold', 'dodgerBlue', 'mediumPurple'] # Creating random shapes import…
J___389
  • 13
  • 3
1
vote
2 answers

R Loop over Arima Model Error in `[<-.ts`(`*tmp*`, ri, only replacement of elements is allowed

Data Frame example: Country= c('Angola', 'Angola', 'Angola', 'Angola', 'Angola', 'Angola', 'Algeria', 'Algeria', 'Algeria', 'Algeria', 'Algeria', 'Algeria') Year= c( 2000, 2000, 2001, 2001, 2002,2002, 2000, 2000, 2001, 2001, 2002,2002) Species= c(…
Pilar Rius
  • 13
  • 3
1
vote
2 answers

Create category by group using a loop

In R, I want to create a "category" variable that depends on differences between the date of birth and the initial date of individuals born within a group (min) (which is in another dataframe), so that an individual will be in a category 1 if was…
ana_gg
  • 370
  • 1
  • 9
1
vote
1 answer

Cannot group boxplots or add manual legend using ggpattern and 2 datasets

I am quite new to R in general and currently struggling with a specific plot I want to create. Preferably I would like to group my boxplots (2 per Area -> Good Habitat, average habitat etc.) and add a legend. Since I am using two datasets from two…
1
vote
4 answers

How To Count Values Inside Deeply Nested Array Of Objects in Mongodb Aggregation

I want to sum of values inside array of objects which have another array of objects. In my case; how can I count 'url' values in all documents inside 'urls' array under 'iocs' array; Mongo playground: open Here is document example; [ { "_id":…
Mbay
  • 75
  • 1
  • 6
1
vote
0 answers

Why can't I find AD security group using the AD User and Computers tool?

I created a security group in AD. Using the AD Users and Computers tool, I can see it when I browse for it at the OU path, but I cannot see it using the "Find" function. Why is that? Result when I browse for the group. Result when I do a "Find" for…
1
vote
1 answer

R ggplot grouped legend of different origin

Im looking for a solution to have grouped legends. Right now it seems that the first fill argument takes over the labeling of the legend. Looking for: Solution to show both data sets separated inside the legend. Problem: Mixed up legend and data…
404rorre
  • 89
  • 7
1
vote
2 answers

How to do a boxplot in R with a missing grouping level and two factors

8 years and eight months ago, the first part of my question was answered perfectly for a boxplot with a missing grouping level by Stephan Kolassa when one level (12) was missing: How to do a boxplot in R with a missing grouping level data <-…
1
vote
3 answers

Grouping List and counting

I have OrderItems class public class OrderItems { public int id; public double portion; and List like below: List orderItems = new ArrayList<>(); orderItems.add(new OrderItems(1,0.5)); …
1
vote
1 answer

Group by timestamp and get mean Dataframe

I generate for each week as csv file. The weeks are then merged into one. The merged CSV with the Dataframe looks like this: machineId | id | mean | min | max machine1 | 2 | 00:00:03.47 |…
hubi3012
  • 75
  • 7
1
vote
1 answer

Select last registered row from each group from two tables in MySQL v5.6

Could you please help me with a query I'm having issues with? I tried to seach for similar questions here with no success. I have 2 tables which I need to join and get the latest created_date from each val1, val2 unique combination. See here for the…
JohnP
  • 33
  • 6
1
vote
1 answer

dplyr :conditional pipeline while grouping

I have a data frame of hourly weather data. I want to group the hours into days and assign values to the new daily data frame when a condition is met and only the mean of the rows that meet that condition: In the daily data frame I don't want to use…
1
vote
0 answers

How to add total for each groups in Multi Level Groups in Tabulator.js table

I have created a tabulator table with Multi Level Groups var table = new Tabulator("#example-table", { groupClosedShowCalcs:true, //show column calculations when a group is closed columnCalcs:"both", //true, both, table,…
yannls
  • 11
  • 2