minimum

Pandas – Minimum rate and corresponding supplier name

Pandas – Minimum rate and corresponding supplier name Question: [I am currently analyzing some price data and would like to know if it is possible to get the lowest rate per lane id and the corresponding name of the supplier who offered the cheapest rate in pandas dataframe] enter image description here Below is my …

Total answers: 1

Minimum cost to set internet in all rooms?

Minimum cost to set internet in all rooms? Question: There are n rooms in a hostel. We want to supply internet to all the rooms, laying a proper network. For each room ‘i’, we can either have a router directly with the cost ‘router[i]’, or connect that room through an ethernet cable pulled from another …

Total answers: 2

How can I use min() without getting "0" or "" for an answer?

How can I use min() without getting "0" or "" for an answer? Question: I’m trying to use min in a list that came from a .csv and some of the values are ” how can I ignore those and also "0"? I tried index1 = (life_expectancy.index(min(life_expectancy,))) print(life_expectancy[index1]) and got nothing, when i tried: index1 …

Total answers: 5

How to create a new column based on minimum value from another column

How to create a new column based on minimum value from another column Question: I have a dataframe with a lot of columns and rows (> 10000), but I need to create a column based on the minimum value from another one Example dataframe: enter image description here So, I need the column "Cantidad min" …

Total answers: 1

take minimum between column value and constant global value

take minimum between column value and constant global value Question: I would like create new column for given dataframe where I calculate minimum between the column value and some global value (in this example 7). so my df has the columns session and note and my desired output column is minValue : session note minValue …

Total answers: 2

I have need the N minimum (index) values in a numpy array

I have need the N minimum (index) values in a numpy array Question: Hi I have an array with X amount of values in it I would like to locate the indexs of the ten smallest values. In this link they calculated the maximum effectively, How to get indices of N maximum values in a …

Total answers: 5

Python: Find index of minimum item in list of floats

Python: Find index of minimum item in list of floats Question: How can I find the index of the minimum item in a Python list of floats? If they were integers, I would simply do: minIndex = myList.index(min(myList)) However, with a list of floats I get the following error, I assume because float equality comparison …

Total answers: 4

find a minimum value in an array of floats

find a minimum value in an array of floats Question: How would one go about finding the minimum value in an array of 100 floats in python? I have tried minindex=darr.argmin() and print darr[minindex] with import numpy (darr is the name of the array) but I get: minindex=darr.argmin() AttributeError: ‘list’ object has no attribute ‘argmin’ …

Total answers: 4

Get the key corresponding to the minimum value within a dictionary

Get the key corresponding to the minimum value within a dictionary Question: If I have a Python dictionary, how do I get the key to the entry which contains the minimum value? I was thinking about something to do with the min() function… Given the input: {320:1, 321:0, 322:3} It would return 321. Asked By: …

Total answers: 16

Numpy minimum in (row, column) format

Numpy minimum in (row, column) format Question: How can I know the (row, column) index of the minimum of a numpy array/matrix? For example, if A = array([[1, 2], [3, 0]]), I want to get (1, 1) Thanks! Asked By: yassin || Source Answers: Use unravel_index: numpy.unravel_index(A.argmin(), A.shape) Answered By: Philipp [Corrected typo] Another simple …

Total answers: 2