Questions tagged [minimum]

Minimum refers to the value in a collection of values that is the least or smallest.

In mathematics, the minimum of a function is the smallest value that the function takes at a point either within a given neighborhood (local or relative minimum) or on the function domain in its entirety (absolute minimum).

Examples

Python

>> import numpy as np
>> np.min([0, 1, 2])
0

See also

1056 questions
-1
votes
3 answers

How to get the minimum and maximum value inside a user-defined array?

I want to get the minimum value and maximum value inside an array. After the user inputs n number of arrays, it will print the minimum and max value inside that array. Here is an example output Here is my code so far public static void…
WiloWisk
  • 137
  • 3
  • 10
-1
votes
1 answer

Finding Minimum Value Error In 2D vector iteration

//Max function is working as intended while the minElev is inserting a huge negative value when it hits the final column of the first row. Not sure what is going on and how to fix.... bool pathfinder::_read_data(string data_file_name) { string…
-1
votes
1 answer

How to set variable min and max value in Flutter

ISSUE I am using a variable called var addedToCart = 0; . How to set a max and min value so that user cannot click more or less than the specified value and var addedToCart will not store the out of range value? I want When + icon clicked add value…
Aman Chaudhary
  • 802
  • 3
  • 10
  • 27
-1
votes
2 answers

finding the minimum, maximum and average of different list in a 2D matrix (two-dimensional) in python

I'm trying to find the min, max, and average of each student after(or within) the matrix. How would I get access to the list of each student's scores within the loop iteration? I've started with finding the minimum within the function(findlowest())…
Sirkel360
  • 1
  • 3
-1
votes
2 answers

How do you use for loop to find the minimum without using something similar to "min" on Python?

This is what I have so far, but I would like to use it without min and with for loop: Numbers = [100, 97, 72, 83, 84, 78, 89, 84, 83, 75, 54, 98, 70, 88, 99, 69, 70, 79, 55, 82, 81, 75, 54, 82, 56, 73, 90, 100, 94, 89, 56, 64, 51, 72, 64, 94, 63,…
AS206
  • 13
  • 4
-1
votes
1 answer

cross-join ids to extract data from other columns within the same R data frame

I have an R data frame like this one (but data wouldn't be sorted by any column): ppl <- structure(list(id = c("I0000", "I0001", "I0002", "I0003", "I0004","I0005", "I0006", "I0007", "I0008", "I0009"), Birth_Date = structure(c(NA, 517, -10246, -8723,…
abu
  • 422
  • 7
  • 14
-1
votes
1 answer

Tell me why use "max,min,sum=arr[0];" this code

I want to print the maximum, minimum, and total sum of input integers but i don't understand why use this code(max,min,sum=arr[0];) #include int main(void) { int arr[5]; int max, min, sum, i; for (i = 0; i < 5; i++) { …
김영훈
  • 3
  • 2
-1
votes
1 answer

finding the max or min value in the (item wise) ratio between two arrays, under some conditions

I have two np.arrays x and y, and wish to find the minimum of the ratios x[i]/y[i] where y[i] is greater than 0, i.e for: x = np.array([1,2,3,4,5]) y = np.array([-1,0,1,2,3]) minimumratio(x,y) should return 5/3. just using min(x/y) would yield -1,…
Achrbot
  • 1
  • 1
-1
votes
1 answer

How to get the index of the value with the smallest difference?

int[] b = new int[4]; int min = 10000; int index = 0; b[0] = arr[0][0]; //b[0]=> b[1] = arr[1][0]; //b[1]=> b[2] = arr[2][0]; //b[2]=> b[3] = arr[3][0]; //b[3]=> for (int i = 0; i < b.length; i++) { if(b[i]>r) b[i]=b[i]-r; else …
user11697100
-1
votes
2 answers

Identify minimum unique element of array

Allow me to emphasise the fact that I am very much a beginner, a fact that I am sure is evident in my code. I need to define a function that identifies the LOWEST UNIQUE (only occurs once) value of an input array, however my current approach is…
Hsch2606
  • 3
  • 3
-1
votes
2 answers

I wrote A Code In Python To find Max And Minimum Of 4 elements out of array of 5 elements

I Was Making A code For Making Sum Of list OF Max And Min. 4 Elements from a list of 5 Elemts . My COde Was Working Fine Until it is Introduced TO large No.'s . def miniMaxSum(arr): sum1=0 small=arr[0]+arr[1]+arr[2]+arr[3]+arr[4] lar=0 …
Garvit Joshi
  • 103
  • 1
  • 10
-1
votes
2 answers

How to find minimum values from array

I've an array tab-delimited like this: rs1000 0.09 red rs1000 0.01 blue rs2000 0.07 yellow rs2000 0.08 black and I'm trying to take the minimum values in the second column for rs in the first one. I expect a result like this: rs1000 0.01…
-1
votes
1 answer

PostgreSQL select closest points in time that match given intervals

I am looking to figure out if I can solve the following problem in SQL, or if I'm better off selecting the values into my scripting language and just bulk update from there. There are some points in time, and there are some time intervals defined by…
cmc
  • 4,294
  • 2
  • 35
  • 34
-1
votes
1 answer

Get minimum value for each group by multiple subgroups

I am using R and have a data table like the following below. The values of var1 and var2 are contextually related (ordered ascending by var1) for each row, whilst var3 is the cumulative total of var3 for each group (by g1, g2, g3). var4 is a…
Michael 96
  • 75
  • 8
-1
votes
1 answer

Pascal File: How do I find the MAX and MIN occurrences of an integer from a file?

I am new to Pascal and have a sample.txt file with the following integers: 1 2 2 1 1 3 3 1 1 4 How do I find the integer from the file with the minimum and maximum occurrences in Pascal language? In the above example, max occurrences would be the…
J Pham
  • 3
  • 1