min Questions

4

I've recently learned about branchless programming. I found example of branchless min method. In pesudocode it's something like this function Max(a, b) { return a * (a > b) + b * (a <= b); }...
Wohlert asked 12/3, 2021 at 18:9

4

Solved

EDIT: maaartinus gave the answer I was looking for and tmyklebu's data on the problem helped a lot, so thanks both! :) I've read a bit about how HotSpot has some "intrinsics" that injects...
Illyrian asked 31/3, 2014 at 1:17

9

Solved

Please consider the following: I recently 'discovered' the awesome plyr and dplyr packages and use those for analysing patient data that is available to me in a data frame. Such a data frame could...
Appendicectomy asked 19/1, 2018 at 14:10

5

I've seen some examples of using SUM() inside an ARRAYFORMULA() in Google Spreadsheets (and oddly enough, they all seem like workarounds) but I can't figure out how to apply them to using MIN() ins...

3

Solved

I would like to obtain the n-th minimum or the n-th maximum value from numerical columns in the DataFrame in pandas. Example: df = pd.DataFrame({'a': [3.0, 2.0, 4.0, 1.0],'b': [1.0, 4.0 , 2.0, 3....
Sublieutenant asked 29/12, 2017 at 17:48

4

Solved

With a dataframe like this one: ID Year Temp ph 1 P1 1996 11.3 6.80 2 P1 1996 9.7 6.90 3 P1 1997 9.8 7.10 ... 2000 P2 1997 10.5 6.90 2001 P2 1997 9.9 7.00 2002 P2 1997 10.0 6.93 if I want to kn...
Enneahedron asked 18/10, 2013 at 12:25

9

Solved

I have a array like so: var arr = [[12,45,75], [54,45,2],[23,54,75,2]]; I want to find out the largest element and the smallest element out of all the elements in the nested array: The min shou...
Kaiserism asked 7/12, 2017 at 9:30

5

Is there a way in HTML5 forms to add a min and max character to a textarea? It seems I can apply it to a regular input using pattern. <input pattern=".{3,}" title="3 characters minimum"> A...
Riga asked 12/8, 2013 at 10:32

8

Solved

I would say all programming languages have functions with these names to choose the lesser or greater of two values: min() & max() floor() & ceil() / ceiling() And some languages have b...
Bacteroid asked 15/3, 2012 at 17:26

4

Solved

Is there a method to swap the maximum and the minimum of a list? The list will be as follows and the program has to be continued so that it will print the maximum swapped with the minimum, the se...
Ensilage asked 4/6, 2014 at 14:21

5

Solved

I am having hard time to figure out how to find min from a list for example somelist = [1,12,2,53,23,6,17] how can I find min and max of this list with defining (def) a function I do not want to u...
Untangle asked 19/11, 2014 at 4:56

4

Solved

I know (-0 === 0) comes out to be true. I am curious to know why -0 < 0 happens? When I run this code in stackoverflow execution context, it returns 0. const arr = [+0, 0, -0]; console.log(M...
Stocking asked 22/12, 2021 at 14:9

2

Solved

I have the a collection of entries as follows: { company:"C3", model:"M3", price:55600, discount:9, ... } and there are more than 2000 entries. I am trying to find out max...
Laden asked 19/10, 2015 at 4:26

18

Solved

----------Updated ------------ codymanix and moonshadow have been a big help thus far. I was able to solve my problem using the equations and instead of using right shift I divided by 29. Because ...
Kanishakanji asked 3/9, 2009 at 20:51

10

Solved

Here's what I'm trying to do. Let's say I have this table t: key_id | id | record_date | other_cols 1 | 18 | 2011-04-03 | x 2 | 18 | 2012-05-19 | y 3 | 18 | 2012-08-09 | z 4 | 19 | 2009-06-01 | a 5...
Effort asked 10/9, 2013 at 17:17

10

Solved

I have an angular4 application with a form. In this one I have an input to enter a percentage. So, I want to block the input with value between 0 and 100. I tried to add min="0" and max="100" but I...
Unseasoned asked 3/8, 2017 at 9:21

6

I have a array like [5.5, 6.0, 6.0, 6.5, 6.0, 5.5, 5.5, 5.0, 4.5]. all numbers of this array differ by 0.5, and the maximum difference of two successive numbers is also 0.5(they can be same; a...
Mannes asked 7/9, 2015 at 10:40

10

Solved

I have a list of numbers and Nones like this: l = [2., None, 3., 1., None, 2., None, 5.] I want to get the minimum number and its index, while the Nones should simply be ignored. For the given e...
Rarity asked 12/6, 2018 at 17:52

9

Solved

i need to know how can i exclude 0 from rows and get the MIN Value. But also i need to exlude the F1 Cell. Ex: A B C D E F 1 0 18 20 0 150 = 18 but if i do this In excel with =MIN(A1,B1,C1,D1,...
Tmesis asked 15/5, 2013 at 22:23

4

Solved

For the following sample data dat, is there a way to calculate min and max while handling NAs. My input is: dat <- read.table(text = "ID Name PM TP2 Sigma 1 Tim 1 2 3 2 Sam 0 NA 1 3 Pam ...
Tremor asked 8/6, 2021 at 11:3

3

Solved

I need to find the max and min value in a dataframe "df" like this: col1 col2 col3 7 4 5 2 NA 6 3 2 4 NA NA 1 The result should be: min = 1 and max = 7. I have used this function: m...
Gaultiero asked 23/5, 2021 at 19:57

3

I'm having some problems to set a minimum and a maximum YEAR with HTML5 date input. Here is my code: <input required="required" min="1900-01-01" max="2099-09-13" ty...
Unicorn asked 6/3, 2014 at 18:13

4

How would one find the minimum value in each row, and also the index of the minimum value? octave:1> a = [1 2 3; 9 8 7; 5 4 6] a = 1 2 3 9 8 7 5 4 6
Winded asked 10/8, 2017 at 8:29

16

Solved

I have an algorithm written in Java that I would like to make more efficient. A part that I think could be made more efficient is finding the smallest of 3 numbers. Currently I'm using the Math.min...
Imes asked 6/3, 2012 at 1:19

4

I have the following data: Date 2020-07-20 -98.109956 2020-07-21 -94.408946 2020-07-22 -76.788330 2020-07-23 -71.094908 2020-07-24 -92.262792 2020-07-27 -97.932848 2020-07-28 -90.236719 2020-07-29 ...
Julejulee asked 27/9, 2020 at 18:3

© 2022 - 2024 — McMap. All rights reserved.