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"...
Ichthyo asked 23/8, 2016 at 9:51

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...
Cerveny asked 19/7, 2016 at 18:38

5

Solved

I just noticed that the new standard defines min(a,b) and max(a,b) without constexpr. Examples from 25.4.7, [alg.min.max]: template<class T> const T& min(const T& a, const T& b)...
Duelist asked 9/4, 2011 at 12:54

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...
Tessitura asked 12/5, 2016 at 20:29

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...
Schlemiel asked 9/5, 2016 at 8:10

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...
Outsail asked 8/12, 2012 at 23:33

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?...
Backhanded asked 16/2, 2011 at 13:19

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...
Fainthearted asked 31/3, 2016 at 13:50

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...
Bostwick asked 22/3, 2016 at 12:35

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...
Gaines asked 18/3, 2016 at 3:23

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...
Elonore asked 16/10, 2015 at 16:12

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 ...
Shulman asked 19/11, 2015 at 3:28

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...
Roxannaroxanne asked 24/7, 2013 at 17:12

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...
Redpencil asked 1/11, 2015 at 23:22

6

Solved

I have a List which contains Dates : List<string> StringDates; [0]: "04.03.2010" [1]: "09.03.2010" [2]: "11.03.2010" [3]: "12.03.2010" [4]: "16.03.2010" [5]: "18.03.2010" [6]: "19.03...
Dobbs asked 25/2, 2010 at 21:30

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...
Alodi asked 20/8, 2015 at 15:0

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...
Gehrke asked 24/2, 2012 at 1:37

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...
Servility asked 11/7, 2015 at 19:52

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...
Patina asked 1/2, 2015 at 1:34

© 2022 - 2024 — McMap. All rights reserved.