Questions tagged [group]
585 questions
1
vote
1 answer
R: My calculated cumulative sample distribution probabilities don't reach 1.0
I want to calculate the cumulative probabilities for my sample for each factor level and save them to a data frame.
However, the calculated probabilites don't reach 1.0 and stop e.g. at 0.7 which cannot be true.
Somehow it always reaches 1.0 only…

Joschi Nin
- 37
- 5
1
vote
1 answer
mongo aggregate query to find records having given time difference between consecutive records of each type
I have mongo collection with data records coming from gps device in every 2-3 second, data sample is as shown here
1. {imei:123456.., port:8000,createdon:timestamp, updatedon : timestamp}
2. {imei:223456.., port:8000,createdon:timestamp, updatedon…

mohammad Idris
- 13
- 4
1
vote
3 answers
Make a function/for loop in R
I have this piece of code that i need to make as a for loop. This code only works for GroupA, and I have a lot of Groups (grouoA, groupB, groupC etc.) - how can i make it into a function/foor loop so it makes a table for all my groups
dt <-…

Hellihansen
- 163
- 6
1
vote
1 answer
Removing duplicates by group
x_TimeGenerated batch_number
22/03/2023 BATCH_1
21/03/2023 BATCH_1
20/03/2023 BATCH_1
19/03/2023 BATCH_1
18/03/2023 BATCH_1
18/03/2023 BATCH_2
17/03/2023 BATCH_2
16/03/2023 …

Lopa
- 51
- 6
1
vote
1 answer
Replace column values using another pandas dataframe mapping
Imagine I have the following dirty data of employee information of their contracts across countries (df1):
ID Country Name Job Date Grade
1 CZ John Office 2021-01-01 Senior
1 SK John . …

Paulo Cortez
- 609
- 4
- 10
1
vote
1 answer
Can MySQL be used to sort a list into thirds?
I need to use a single query to sort a table into an order where there are three even batches of sorted records.
Here is an example table...
id value
1 356
2 243
3 321
4 123
5 654
6 222
7 102
8 900
9 …

EFC
- 1,890
- 18
- 39
1
vote
1 answer
I have 2 kinds of posts (sponsored and non sponsored) for X users. I want to know for each post of a user when the last sponsored post happened (days)
I have 2 kinds of posts (sponsored and non sponsored) for many users. I know the date when each post happened. Now I need to know for each post of a user when the last sponsored post happened (in full days) see the column "Days since last…

Max Di Milian
- 13
- 3
1
vote
2 answers
Django Group by month and payment mode, get a report in template only for the datas present
In my database I have only data up to 'March' so I need only up to 'Mar'
I want achiever monthly sum grouped by 'mode'
def by_mode(request):
all_modes = dict(Transactions.PAYMENT_MODE_CHOICES).keys()
totals = Transactions.objects.annotate(
…

Jamal A M
- 45
- 3
1
vote
1 answer
Collecting Google Slides Shapes into a Group Using Apps Script
I have a Google Apps Script that generates 15 to 20 ellipses in specific places on a slide. I have not been able to find how to collect the generated ellipses into a group programmatically. Any insight would be most appreciated.
I have researched…

BJS
- 23
- 6
1
vote
1 answer
Django Group by month and display in template by month
`class Daily(models.Model):
transid = models.AutoField(primary_key=True)
transdate = models.DateField()
transdetails = models.ForeignKey(Details, on_delete=models.CASCADE)
transcategory = models.ForeignKey(MasterCategory,…

Jamal A M
- 45
- 3
1
vote
1 answer
Creating a new column using existing columns, but in non-exclusive conditions
This is for a case study.
I have the following table, T1 with two columns: c1, c2
C1 C2
1 3
5 2
4 10
I want to create a table T2 with both C1, C2, and a new column C3 defined in a way that
if C1 > 3 then C3 =…

user98235
- 830
- 1
- 13
- 31
1
vote
2 answers
Merge two Dataframe without duplicate rows pandas
We have problem in merge two different Pandas data frame, using the merge method it duplicate the rows with the same ID
We have two different DF in Pandas:
DF1:
ID Gender
0 1 Male
1 2 Female
2 3 Female
DF2
ID Vote
0 1 30
1 …

Acco
- 23
- 4
1
vote
2 answers
Excel - group and sort by condition
Hi
I have an inventory list with a lot of products/IDS etc
I want to find out how many products is in one group only.
In the picture above there will be products 455 and 700 - those are the only one that have one group only - the other products…

Henrik Rosqvist
- 65
- 1
- 1
- 7
1
vote
2 answers
R: splitting dataframe into distinct subgroups containing sequence of groups
This question is similar to one already answered: R: Splitting dataframe into subgroups consisting of every consecutive 2 groups
However, rather than splitting into subgroups that have a type in common, I need to split into subgroups that contain…

mkmor
- 11
- 3
1
vote
1 answer
LINQ Group By and Intersection between groups C#
I have the following list into C#:
table_schema | table_name | field_name | field_type
public tableA fieldA character varying
public tableA fieldB timestamp
public tableA fieldC …

Stavros Koureas
- 1,126
- 12
- 34