grouping Questions
3
Solved
I want to remove rows from my array so that my result is an array that contains rows with unique first and last elements. If two (or more) rows have the same first and last value, I want to preserv...
Atahualpa asked 21/2, 2012 at 20:15
2
My array is like this:
myArray = [
{date: "2017-01-01", num: "2"}
{date: "2017-01-02", num: "3"}
{date: "2017-02-04", num: "6"}
{date: "2017-02-05", num: "15"}
]
I want to convert this into:...
Stockdale asked 27/1, 2017 at 7:26
5
Solved
I have some data which looks like this (fake data for example's sake):
dressId color
6 yellow
9 red
10 green
10 purple
10 yellow
12 purple
12 red
where color is a factor vector. It is no...
7
Solved
Let's say that I have an array of arrays, like so:
[
[0, 1, 3],
[2, 4, 6],
[5, 5, 7],
[10, 0, 3]
]
How do I generate a new array that sums all of the values at each position of the inner arr...
Urus asked 24/12, 2015 at 21:37
4
Solved
There are lots of data coming from multiple sources that I need to group based on priority, but the data quality from those sources is different - they may be missing some data.
The task is to grou...
Unstrap asked 22/12, 2021 at 18:32
4
I am not able to limit the amount of pushed elements in a group function with aggregation pipeline. Is this possible? Small example:
Data:
[
{
"submitted": date,
"loc": { &q...
Reparative asked 6/7, 2014 at 8:30
5
Solved
I use mongodb for my blog platform, where users can create their own blogs. All entries from all blogs are in an entries collection. The document of an entry looks like:
{
'blog_id':xxx,
'timest...
Haphazard asked 27/6, 2011 at 20:22
5
Solved
I need a SINGLE query that does this sequence in oracle.
select count(*) from table1
where request_time < timestamp'2012-05-19 12:00:00' and (end_time > timestamp'2012-05-19 12:00:00' or end...
5
I'm using JasperReports and iReport (output to PDF), and I have a problem with a certain report:
Inside the report I have defined a group. On average, each "instance" of that group only contains a...
Ayurveda asked 11/7, 2010 at 11:30
2
Solved
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....
6
Solved
I use $project operator to extract week part from Date, then do grouping by weeks in aggregation pipeline:
{ $project: {
year: { $year: [ "$datetime" ] },
week: { $week: [ "$date...
4
Solved
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(&qu...
1
Solved
In my dataset respondents are grouped together and there is data available about their age. I want all the people in the same group to have the value of the oldest person in that group.
So my examp...
Methylal asked 30/11, 2021 at 13:25
5
Solved
Suppose I have a group of bumper cars, which have a size, a color and an identifier ("car code") on their sides.
class BumperCar {
int size;
String color;
String carCode;
}
Now I need...
Plumbery asked 18/1, 2019 at 12:29
2
Let say we have a collection like this in Javascript:
[
{ date: 'Fri, 02 May 2014 19:05:00 GMT', value:'abc' },
{ date: 'Fri, 02 May 2014 23:43:00 GMT', value:'jkl' },
{ date: 'Fri, 02 May 2014...
Dewittdewlap asked 30/5, 2014 at 22:4
2
Solved
I want to iterate over groups that are grouped by strings or dates.
df = pd.DataFrame({'A': ['foo', 'bar'] * 3,
'B': ['me', 'you', 'me'] * 2,
'C': [5, 2, 3, 4, 6, 9]})
groups = df.groupby('A')
...
6
Solved
I have a List fooList
class Foo {
private String category;
private int amount;
private int price;
... constructor, getters & setters
}
I would like to group by category and then sum amo...
Thamos asked 28/8, 2018 at 12:44
5
Solved
I have a array like this:
$str=
Array
(
[No] => 101
[Paper_id] => WE3P-1
[Title] => "a1"
[Author] => ABC
[Aff_list] => "University of South Florida, Tampa, United States...
4
Solved
I have a dataset that looks like this toy example. The data describes the location a person has moved to and the time since this relocation happened. For example, person 1 started out in a rural ar...
7
Solved
I have a table with two columns that might be null (as well as some other columns). I would like to count how many rows that have column a, b, both and neither columns set to null.
Is this possibl...
3
Solved
Leaving aside the libraries that provide row grouping for their particular tables, I am trying to implement such a feature on Angular Material 2 mat-table which does not come with such a feature.
...
Entrant asked 7/9, 2018 at 7:12
6
Solved
What's a good algorithm to solve this problem?
I have three groups of people - group A, group B, and group C. There are the same number of people in each group. They each have a list of people in ...
Toboggan asked 17/11, 2008 at 0:57
5
Solved
I am writing an Excel exporter for a bespoke application I am creating, and I have a question about LINQ grouping in C#.
Basically, this new Excel exporter class is given two dates. The class then...
3
Solved
I am using Xamarin.Forms for developing mobile apps for Android and windows Phone.
I have a listview of messages which is bound to an ObservableCollection of groups. The list groups the messages b...
Seto asked 22/4, 2015 at 1:19
6
Solved
Suppose I had an array:
[1, 8, 5, 6, 10, 9, 11, 12];
I want to sort it by ascending order, but find out the maximum groups I would need to sort. In this example, the answer would be:
[1], [8,...
© 2022 - 2024 — McMap. All rights reserved.