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
9
votes
6 answers

Efficient way to get index of minimum value in long vector, python

I have a long list of longitude values (len(Lon) = 420481), and another one of latitude values. I want to find the corresponding latitude to the minimum of the longitude. I tried: SE_Lat = [Lat[x] for x,y in enumerate(Lon) if y == min(Lon)] but…
Ronja
  • 93
  • 1
  • 4
9
votes
5 answers

How to find all minimum elements in a list of tuples?

How can I find all the minimum elements in a list? Right now I have a list of tuples, i.e. [(10,'a'),(5,'b'),(1,'c'),(8,'d'),(1,'e')] So I want the output which is all the minimum elements of the list, in a new list. For example …
llamaro25
  • 642
  • 1
  • 7
  • 22
9
votes
1 answer

Extracting minimum values per row using numpy

I have a question and I could not find the answer on the internet nor on this website. I am sure it is very easy though. Let's say I have a set of 20 numbers and I have them in a 5x4 matrix: numbers = np.arange(20).reshape(5,4) This yields the…
user3891296
  • 91
  • 1
  • 1
  • 2
9
votes
1 answer

How can I help Clojure understand that 0 is the smallest natural number?

It's easy to define a lazy sequence of natural numbers in Clojure: (def N (iterate inc 0)). Unsurprisingly, if we ask Clojure to find the minimum of N using (apply min N), it gets stuck in an infinite regress. Is there a way to "build in" the fact…
9
votes
1 answer

Atomic Minimum on x86 using OpenMP

Does OpenMP support an atomic minimum for C++11? If OpenMP has no portable method: Is there some way of doing it using a x86 or amd64 feature? In the OpenMP specifications I found nothing for C++ but the Fortran version seems to support it. See…
B.S.
  • 1,435
  • 2
  • 12
  • 18
8
votes
3 answers

Number of Comparisons finding the median of 7 numbers

I can find the median with 12 comparisons. But I want to know the minimum number of comparisons and how to do it.
zerr
  • 83
  • 3
8
votes
3 answers

Boost program options setting min and max value for option

Is it possible to set minimum and maximum limit of a value (suppose it is unsigned short and I need a value between 0 and 10) as I can set default value by opt::value()->default_value(5) I want to use arguments given from variables…
VP.
  • 15,509
  • 17
  • 91
  • 161
8
votes
2 answers

R getting the minimum value for each row in a matrix, and returning the row and column name

I have a matrix like so: Only in reality it is hundreds or thousands of values. What I need to do is return the minimum value for each row, along with the row/col name. So for row 1 in the example, "BAC", the minimum is 0.92 for BAC/CSCO, so I need…
ctrlbrk
  • 1,174
  • 2
  • 17
  • 27
8
votes
7 answers

Get the minimum and maximum values in an array column

I have an array in this format: $array = [ ['id' => 117, 'name' => 'Networking', 'count' => 16], ['id' => 188, 'name' => 'FTP', 'count' => 23], ['id' => 189, 'name' => 'Internet', 'count' => 48], ]; Is there a good way to retrieve the…
James B
  • 219
  • 1
  • 3
  • 6
8
votes
4 answers

Is this minimalist HTML5 markup valid?

Hello, world! SOURCE FOR CODE If so, besides removing "Hello, world!" is there any tag that's able to be removed and it still be valid, and how do you know it's still valid?
blunders
  • 3,619
  • 10
  • 43
  • 65
7
votes
1 answer

Hungarian algorithm with multiple assignments

Let's say we're given N jobs and K workers to do those jobs. But for some jobs we need 2 employees, while for some we need just one. Also the employees can't do all jobs. For example worker 1 can do jobs 1,2 and 5, while not jobs 3 and 4. Also if we…
Stefan4024
  • 694
  • 1
  • 10
  • 21
7
votes
1 answer

Why are three nodes the recommended minimum number of nodes for Couchbase?

For Cassandra, there is a minimum requirement of three nodes to enable writes with strong consistency, assuming a replication factor of one (i.e. two copies of the dataset). This requirement does not seem to be the case for Couchbase, at least I…
00prometheus
  • 767
  • 7
  • 20
7
votes
1 answer

Set minimum iPhone OS version for app?

I'm about to publish an app on the app store, and I'm looking to set the minimum OS version as it appears in iTunes as "Requires iPhone OS 3.x or later". 2 questions: 1) Where do I set this in my Xcode project? 2) I'm aware of the UITableViewCell…
quantum
  • 1,400
  • 6
  • 21
  • 34
7
votes
2 answers

Sliding window minimum/maximum in 2D

Suppose we are given an integer matrix of pixels of size NxN and an integer k - window size. We need to find all local maximums (or minimums) in the matrix using the sliding window. It means that if a pixel has a minimum (maximum) value compared to…
Andrei Baskakov
  • 161
  • 2
  • 3
6
votes
4 answers

Finding the minimum of an array using recursion?

Ok, so I've been trying to wrap my head around recursion in Java and I can accomplish easy tasks such as sum, reversing etc. but I have been struggling to do this exercise: I'm trying to find the minimum number in an array using recursion but keep…
Vance
  • 471
  • 4
  • 8
  • 16