min Questions
3
Solved
I would like to get a column that has the earliest date in each row from multiple date columns.
My dataset is like this.
df = data.frame( x_date = as.Date( c("2016-1-3", "2016-3-5", "2016-5-5"...
2
Solved
Is it safe to assume that -LLONG_MAX (negated LLONG_MAX) belongs to long long range?
Is it safe to assume that if LLONG_MIN < -LLONG_MAX then LLONG_MIN == -LLONG_MAX - 1?
Is it guaranteed by t...
5
Solved
2
Solved
I just answered this question with a data.table approach, and was working hard to provide a dplyr equivalent, but failed misserably.
There's a simple data frame with numerical values in its column...
1
Solved
I am trying to return a tuple the smallest second index value (y value) from a list of tuples. If there are two tuples with the lowest y value, then select the tuple with the largest x value (i.e f...
2
Solved
So I have this list called sumErrors that's 16000 rows and 1 column, and this list is already presorted into 5 different clusters. And what I'm doing is slicing the list for each cluster and findin...
7
Solved
i have a column ID and something like 1000 items, some of then were removed like id=90, id=127, id=326
how can i make a query to look for those available ids, so i can reuse then for another item?...
4
Solved
I'm trying to figure out away to split the first 100,000 records from a table that has 1 million+ records into 5 (five) 20,000 records chunks to go into a file?
Maybe some SQL that will get the min...
3
Solved
When I try to compile this,
#include <iostream>
struct K{
const static int a = 5;
};
int main(){
K k;
std::cout << std::min(k.a, 7);
}
I get following. Both gcc and clang gives...
1
Solved
Let's say we have an array of ints: a = {2,4,3,5}
And we have k = 3.
We can split array a in k (3) sub arrays in which the order of the array cannot be changed. The sum of each sub array has to b...
5
Here is the task came to me from a code review. I want to select a minimum value from a set, based on a special kind of compare predicate. Like this:
struct Complex { ... };
float calcReduction(C...
1
Solved
Lets say we have this array and I want to replace the minimum value with number 50
import numpy as np
numbers = np.arange(20)
numbers[numbers.min()] = 50
So the output is [50,1,2,3,....20]
But ...
3
Solved
I'm trying to find the minimum array indices along one dimension of a very large 2D numpy array. I'm finding that this is very slow (already tried speeding it up with bottleneck, which was only a m...
3
From experiment I have relised that when in a case of a tie,
python picks based on order (e.g. the item that comes in first in a list)
Is there a way, where in the case of a tie i can choose an ite...
6
Solved
2
Solved
[20, 32, 32, 21, 30, 25, 29, 13, 14].min(2)
# => [13, 20]
Why isn't it [13, 14]? And how do I get what I want, the two smallest elements (in linear time)?
The doc's sentence "If the n argumen...
3
Solved
I am looking to write a method in Java which finds a derivative for a continuous function. These are some assumptions which have been made for the method -
The function is continuous from x = 0 t...
Oratory asked 8/8, 2015 at 20:24
10
Is there any way to make this function more elegant? I'm new to C++, I don't know if there is a more standardized way to do this. Can this be turned into a loop so the number of variables isn...
3
Solved
I'm finding max value and min value of a list by using max(list) and min(list) in Python. However, I wonder how to manage empty lists.
For example if the list is an empty list [], the program rai...
Despite asked 13/4, 2014 at 21:59
1
Solved
My C++ program uses unsigned ints of different widths to express constraints on what data can be represented. For example, I have a file whose size is a uint64_t, and I wish to read it in chunks wi...
5
So i'm trying to implement a binary min heap. I understand what the binary min heap entails in terms of it's structure and it's properties. However I'm hitting a wall when I'm trying to implement i...
Joiejoin asked 1/4, 2011 at 20:36
4
Solved
Is there a way in iOS for me to get the Max and Min values of an NSMutableArray of double numbers. I'm looking for an already existing method, not for me to sort the array my self. If there is a me...
Tackle asked 6/2, 2012 at 16:27
13
I use SQL Server 2008 R2.
I need to sort a table by the minimal value of two columns.
The table looks like this:
ID: integer;
Date1: datetime;
Date2: datetime.
I want my data to be sorted b...
Aperture asked 13/4, 2015 at 8:15
4
Solved
This is a part of a book I'm reading to learn Objective-C.
The following defines a macro called MAX that gives the maximum of two
values: #define MAX(a,b) ( ((a) > (b)) ? (a) : (b) )
And t...
Maria asked 29/7, 2012 at 16:3
2
Solved
Tracing back a ValueError: cannot convert float NaN to integer I found out that the line:
max('a', 5)
max(5, 'a')
will return a instead of 5.
In the above case I used the example string a but i...
© 2022 - 2024 — McMap. All rights reserved.