9,095 questions
Advice
0
votes
8
replies
175
views
Finding the max values for list values for each key in a dictionary without using max()
Let's say I have a dictionary such as:
dict = { "Mars": [4, 3, 4, 7, 10], "Jupiter": [6, 6, 7, 9, 11], "Saturn": [4, 5, 12, 22, 1]}
I would like to iterate through each ...
7
votes
2
answers
286
views
What is the difference between fmax, fmaximum, and fmaximum_num, and which one should I use?
C23 now has four different ways of computing the maximum or minimum of two floating-point numbers:
x > y ? x : y for maximum (or the other way for minimum)
fmax / fmin
fmaximum / fminimum
...
-2
votes
3
answers
108
views
make a list according to max count [duplicate]
I have a list
my_list = [3,8,11,8,3,2,1,2,3,3,2] # my list
max(my_list, key=my_list.count) # most frequent number appeared on the list
But i want to make a list according to the most frequent ...
0
votes
0
answers
45
views
Power BI - MIN/MAX Issue
I have the following matrix in Power BI with the measures "First Period", "Second Period", "<> Change", and "% Change" (the DAX code for the First Period ...
1
vote
1
answer
115
views
What is the return value of Array.max when array contains NaN?
Looking at the documentation for Array.max (https://developer.apple.com/documentation/swift/array/max()), I see it says that it returns "the sequence’s maximum element."
I wonder how that's ...
0
votes
0
answers
41
views
React Native GiftedChat: Maximum update depth exceeded error on minimal example
I am building a chatbot screen in React Native CLI using the react-native-gifted-chat package (version 0.16.3). However, when I run even a minimal example, I get the following error:
Maximum update ...
0
votes
1
answer
67
views
Trying to search a specific column range of 45 to 64 only
My formula works but if 44 or less or 65 or greater number is entered, I get “XLOOKUP couldn’t find the requested value”. That’s why I want to limit the search to only include a number range from 45 ...
-3
votes
1
answer
103
views
VBA calculation of Maximum, minimum, Mean and Median for values in a column [closed]
For reasons unknown, the Application.WorksheetFunction procedures do not work on my Excel and so I am trying to do these calculations using VBA. I have written a sub routine for these calculations but ...
0
votes
3
answers
95
views
Google Sheets: Return latest date from one column depending on variables in 4 other columns
I am looking for a Google Sheet formula to help me find and return the date from another column, depending on variables from other multiple columns.
Here's a spreadsheet with my issue.
I would like ...
0
votes
1
answer
41
views
How to "decouple" additional columns from max() function in SQL
I have a table that displays values for some devices. Each row is a separate reading at a distinct time interval. Row 1 = reading at 00:00, Row 2 = reading at 00:30, and so on...
I want to get the max ...
0
votes
0
answers
11
views
Number of charactes per single word CSS [duplicate]
How do I set the limit of characters per single word within a text paragraph in CSS? Something like max-word-length. I am NOT talking about the total number of characters in the paragraph.
In fact, ...
2
votes
3
answers
105
views
Count the number of times a column has the max value in the row
In google sheets, How do you calculate the number of wins a player has from the sample data below? I want a formula to use for the win row.
The formula should count the number of times the player has ...
0
votes
2
answers
78
views
Getting single MAX() row of Calculated Column within a Specific Time Interval in SQL
I am trying to get the MAX() of the sums of amps_a + amps_b + amps_c within the month of March for the ID column. This should return a single row for the highest sum for the month of March (or at ...
2
votes
1
answer
59
views
Pandas group by - maximum row for a subset [duplicate]
I have a dataframe with weekly product sales
product_id
week_number
sales
A1
1
1000
A1
2
2000
A1
3
3000
A2
1
8000
A2
2
4000
A2
3
2000
I want to add a column that identifies rows where the total sales ...
3
votes
4
answers
224
views
Fastest way to find indices of highest value in a matrix iteratively and exclusionarily
For the sake of anyone who stumbles upon this in the future, I apologize – I had conceived of the problem and solution incorrectly. A proper implementation of finding the coordinates of pairwise best ...
0
votes
1
answer
79
views
MySQL Select MAX() & Group By do not work as I want [duplicate]
I have 2 tables with 50k+ & 10k+ rows
Table chapter
id (auto_inc) | chapter_id | story_id | date (timestamp)
1 | 1 | 1 | 1715830560
...
10 | 10 | 1 ...
0
votes
0
answers
26
views
Maximum call stack exceeded
Issue:
I used Clerk middleware, but it didn't work, and I encountered a Maximum Call Stack Error. Additionally, my middleware.ts file sometimes doesn’t compile.
Here’s my middleware.ts file:
import { ...
1
vote
1
answer
107
views
In Presto sql, how to grab the maximum timestamp in between two events within a table
I have a table df like below, my goal is to find the largest 'focus' timestamp after each visit for each [user:session] pair. (Timestamp as BIGINT data type and in ascending order)
event
user_id
...
-1
votes
1
answer
77
views
pandas get min and max value for multiple rows
i have these cols "Price", "functions", & "cat" as df.
Price functions cat
51272.85 8 3-8
51134.15 3 3-8
51150 8 3-8
51161.3 1 1-6
51165.45 1 ...
0
votes
0
answers
77
views
AppLovin onAdHidden(Interstitial Ad) send callback lately, it takes almost 2 to 3 seconds to tell that ad is dismissed
Description
I want to prevent the delay happened when onAdHidden called, or some other method which I should follow for quickly navigte through screens when ad is dismissed.
**
MAX SDK Version**
com....
0
votes
2
answers
79
views
Python Selenium find_elements() only returns 100 items when more are available
I have a problem with Selenium, python. The method find_elements(By...) only returns 100 items when there are far more available. Here is (a part of) my code:
url = "https://www.falstaff.com/de/...
0
votes
6
answers
212
views
In Excel or Google Sheets, how to return the highest value of a string with a number in another cell?
I have a column which contains different Letters each with a corresponding number. I.E. (F1, F2, F3) denotes three products from the 'F' category, and (G1, G2, G3) denotes products from the "G&...
-2
votes
2
answers
262
views
Using SQL , how do I select the max values when there is more than one with the same max value?
I am trying to select the maximum ImportDate for each person. For this person "Bob James" he should have the last 2 rows selected with ID 267311 and 267342. I need to see every column in the ...
0
votes
1
answer
40
views
Looking for equal maximums in a range
I have a list of scores and need to find the maximum value; i.e. the winner(s) but also identify any duplicates of that max value. In other words, a top score wins and on occasions there may be equal ...
0
votes
0
answers
126
views
Do you know why my max function with an initializer list in c++ is throwing error: expected expression?
I'm trying to find the maximum of three variables and placed them in curly braces to make it an initializer list inside of the max() function.
I've used this method before and it should work on this ...
2
votes
1
answer
63
views
Is there a way to return the highest value in Excel?
The Problem
I'm working directly on a Excel sheet with the Python extension for Excel and I'm trying to find out which is the highest number of a list of cells.
This is the code for the function that ...
1
vote
0
answers
25
views
When a column has multiple values per user how do I select the most recent one according to date in another column? [duplicate]
Below is the query which works fine however Status column can have several values per user and I only want the row with the most recent date. This is in another column called modified in the ...
-2
votes
1
answer
99
views
How to generate an annual return (performance) table of several securities accounts in Excel
I have a data set which consists of the following structure and would like to generate an annual return table. Data can be for only first day of each year, or sometimes monthly intervals as well. For ...
1
vote
2
answers
110
views
Initialize a integral variable to +/- infty for a running min/max in Haskell
In running minimum/maximum problems, the e.g. minimum-so-far is often initialized to \infty in order to guarantee we "capture" every minimum, no matter where it is located.
In Haskell, we ...
1
vote
1
answer
122
views
How/Where does PyTorch max documentation show that you can pass in 2 tensors for comparison?
I am learning pytorch and deep learning. The documentation for torch.max doesn't make sense in that it looks like we can compare 2 tensors but I don't see where in the documentation I could have ...
0
votes
2
answers
105
views
Why does (type)-1 return the max value for a type in C++?
While reading the source code for RakNet on GitHub, I came across the following in RakNetDefines.h.
typedef unsigned char RPCIndex;
const int MAX_RPC_MAP_SIZE=((RPCIndex)-1)-1;
const int ...
1
vote
3
answers
84
views
How do I find the highest sum of multiple cells in column A where the sum is based on multiple cells matching in column B in Google Sheets?
I deeply apologize for the title being unclear. It is difficult to explain what I am looking for in such a small amount of characters. To provide some background, see the table below for reference.
...
1
vote
1
answer
48
views
Max value based on criteria among two joint tables in Access
I have two tables in access with different dates for one and the same order ID. In first one I have only one record per order with date. In the second one I have multiple records per order with ...
1
vote
3
answers
219
views
How to Filter Table by Max Value
I have the following table:
PRODUCT
LABEL
TRANSLATION
VALUE
Label1
Translate1
104
Label2
Translate2
102
Label3
Translate3
110
These values are pulling from another table based on matching product code....
0
votes
1
answer
127
views
Convert row_number to SQL join and top1 functions
I am looking for this query to be re-written using sub-queries, top 1 or max function, however due to the nature of data in underlying tables, not able to achieve it. Appreciate if you can help on ...
1
vote
2
answers
221
views
How do I find the min and max of a value of one column in postgresSQL and have it return only 2 rows?
I'm using postgresSQL and would like to find the minimum value and the maximum value in one column. I have to have a column titled Order ID, Minimum Order, Maximum Order in the query. See the below ...
-2
votes
2
answers
67
views
Combine rows on multiple values removing null in SQL Oracle
I have calibrations logs for a piece of equipment. There are 3 calibration types that need to be logged daily, with failing results needing a retest.
Data can look like below in One day:
EQUIPMENT #
...
2
votes
0
answers
54
views
How to Implement Overflow Handling in Go [duplicate]
I was coding and I wanted to add too many numbers, which I get from the user. I think that if the result of adding these numbers is greater than int64, it should give an error and indicate an overflow....
1
vote
1
answer
86
views
jam.py how to find the last item of a field and compute a running sum?
I am new with JAM.py and I am trying to create a maintenance database for aircraft.
On the form used to enter the data, I am entering the tachymeter time in (tach_in, beginning of the flight), and out ...
1
vote
1
answer
248
views
How to represent a max integer value in Gleam
In languages like python we have functions like math.inf or float("inf") to represent an infinite value that can still be used as a number.
Does Gleam contain a function or operation that ...
2
votes
4
answers
147
views
Flag the max value in each column of a DataFrame as True and the rest as False
I have a DataFrame that I am rounding. After the round, I subtract the original from the resultant. This gives me a data frame with a shape identical to the original, but which contains the amount of ...
-2
votes
1
answer
215
views
Codility max profit problem: why accumulated difference sum solution equivalent to 2 index difference solution?
An array A consisting of N integers is given. It contains daily prices of a stock share for a period of N consecutive days. If a single share was bought on day P and sold on day Q, where 0 ≤ P ≤ Q <...
0
votes
1
answer
126
views
Max() and Min() have different behaviours?
Why is the behaviour of min() different from max()?
Select
max(My_Date) over (order by My_Date) as Max_Datum
, min(My_Date) over (order by My_Date) as Min_Datum
From
(
Select dateadd(m,-1,...
0
votes
1
answer
119
views
What is the maximum number of edges in a graph with n vertices
The maximum number of edges in a graph with 𝑛
n vertices depends on whether the graph is directed or undirected.
It looks like you're asking about the maximum number of edges in a graph with 𝑛
n ...
0
votes
1
answer
123
views
How to draw a horizontal line in the indicator pane at the 52-week-maximum value of the line indicator
I try to draw a simple horizontal line in the indicator pane, but this does not work:
var float maxLevel := ta.highest(myseries, 52)
hline(show_maxLevel ? maxLevel : na, "52-Week Max", color=...
0
votes
2
answers
123
views
Excel extracting values from multiple tests
Ultimately I am trying to find the average of the top 3 values per test on the latest day for "Person 1". I am able to find the latest day using the Large(If()) formula, and I am able to ...
2
votes
1
answer
54
views
How to get a object in a list using Min and Max together on two different columns in the same line query C#
I have a list:
ID
REST
AMOUNT
A
10
100
B
08
100
C
03
100
D
06
100
E
07
200
F
04
200
G
09
300
H
06
400
I
08
500
I've tried and didn't work:
var t = Mylist
.GroupBy(f => new { f.ID,f.REST,f....
-1
votes
4
answers
119
views
SQL: group by to select max observation
Imagine you have the following table named city:
market
product
cost
A
1
54
A
2
62
A
3
38
B
1
12
B
2
12
B
3
5
I need the most expensive product for each market, i.e.:
market
product
cost
A
2
62
B
1
12
...
0
votes
3
answers
74
views
Select Most Recent Invoice Price for Customer versus Quote Price
I have two tables I would like to query and compare. I want to find the most recent price a customer has paid and compare it to the most recent price they were quoted for the same item but only ...
1
vote
1
answer
108
views
How to find the local maximum
I write a VBA code to find local maximum in certain scenario and it works perfectly. However, in a bit changed scenario it gave me the maximum value, (not the one in circle) and I can't figure out how ...