Questions tagged [average]

In mathematics, an average is a measure of the "middle" or "typical" value of a data set. Different types of averages include the arithmetic mean, the median, and the mode.

Filter by
Sorted by
Tagged with
0 votes
0 answers
13 views

Averaging/synchronising spectrograms with slightly different time bases

I have a number of spectrograms I wish to average together. There are multiple features in these spectrograms: Start burst (at 0 ms), BroadBand Fluctuation (BBF) (~9.5 to 13 ms and ~190 to ~220kHz) ...
7 votes
7 answers
234 views

Given an array of bytes, how can I create a byte where each bit contains the mode (average) value for bits in that position from the input?

I'm trying to figure out quick and easy way to find the mode ("average") of each bit in an array of bytes. Here is an example of what I an looking for: Byte 1 1010 1010 Byte 2 0101 0101 ...
  • 83
0 votes
3 answers
42 views

How can I normalize columns to an average of 1

enter image description here Take this column as an example I expect the average of the new column to be 1
2 votes
1 answer
39 views

What averaging algorithm can be employed for this case?

I want to average an upcoming single array but having difficulty to write a good algorithm. And to clarify the question. I will receive single arrays as: a1, b1, c1, ... ,a2, b2, c2 ... And I want to ...
  • 555
-3 votes
1 answer
30 views

How to iterate over rows in pandas data frame, with reference to two column at the same time [closed]

I have a df as seen below, I want to calculate average from speed_InMeterS column, with respect to time, and lane. In other word, at time 1 I need average speed for lane x. enter image description ...
0 votes
1 answer
24 views

pandas series average of values

I have a pandas series like this 0 [['word1', 527], ['word2', 708]] 1 [['word3', 976], ['word1', 980], ['word3',... where the values are in the form of a string. Basically this whole ...
  • 27
0 votes
1 answer
62 views

I need a formula to show me how munch more of a Quantity I need to Invest to make my Cost Avg equal/as close to the dollar of Current Price

Note: (The Cost Avg is dividing the Investment by Quantity) I understand what the math equation would look like but not how to make it into an excel formula. I am trying to solve for X. Can you help ...
-1 votes
0 answers
35 views

Rolling average function using calculated values

I want to make a rolling window/average function. For example, I have the table below with historic dates and future dates. The historic dates have actual data and the future dates have no data (NULL ...
  • 60
0 votes
0 answers
9 views

casual mean of vectors as part of a batched tensor

I have a numpy tensor of shape [b_size,length,dim] where in the "length" dimension the vectors should be aware of only the previous once while computing their average, i.e., the output ...
  • 528
-2 votes
0 answers
93 views

Java nested loops finding the average of 5 students [closed]

How do I write a Java program that will compute the average scores of 5 students for 3 subjects(3 marks each student) using nested loops? It's supposed to let the user enter 3 marks for 5 times (...
-1 votes
0 answers
21 views

Python: Reading an excel file with multiple columns and taking an average of each column whenever a condition is met

I have a data set in an excel spreadsheet consisting of 7 columns (with headers) like this: column1 column2 column3 column4 column5 column6 column7 44 10 25 14 10 8 ...
  • 1
0 votes
0 answers
83 views

How to calculate average in SQL/Big Query?

I have product shopping returns data that is stored like: item_id store_id rtrn_tmst 1003632052 571 2019-01-16 07:00:06 UTC where rtrn_tmst indicates the time the item was returned at the store. ...
  • 29
0 votes
1 answer
16 views

Finding an average on Google Sheets based on another column's name

I'm currently working on Google Sheets and was wondering how I could query an average for one numerical column based on the conditional naming of a qualitative column. In this example, I'm trying to ...
0 votes
0 answers
43 views

SQL Queries in Biq Query with Average

I am trying to answer two questions: a) How do I convert a data field from string to integer and find the average of the data field? b) How do I obtain to find the average based on unique values? I ...
0 votes
2 answers
36 views

Calculate Average/mean for grouped values using np.arange and pd.cut with different stop values (and bins) or any other way

I have the following dataframe df2 = pd.read_csv('arangerr2.csv') hgroup lowgroup value max_hg_value 0 A B 0 39 1 A B 18 39 2 A B ...
-1 votes
3 answers
54 views

How can I create a function to find the average of a list?

I'm trying to create a functional for the average of a list that accepts three parameters: a mandatory list of numbers, an optional minimum value which defaults to zero, and an an optional maximum ...
0 votes
3 answers
40 views

Why VBA code for "average" generates a result differing from Excel SUM()?

Result of VBA code Worksheetfunction.Average differs from the result got by Excel +SUM(range) function. I've put up the VBA script as below in order to calculate the occurences of specific values in a ...
0 votes
0 answers
32 views

How to calculate average dollars sold per hour?

I have a spreadsheet that has in and out times per transaction and how many dollars each transaction was. I am trying to have the spreadsheet update with another column that will tell me How many ...
-4 votes
1 answer
40 views

How to calculate average of array in PHP?

So I have in this array code $numers = array ( array(198,208,109,11,636), array(198,188,84,55,756), array(194,206,113,13,531), array(184,213,127,18,101), array(194,213,127,23,110), array(...
0 votes
0 answers
14 views

Compute the tangential average of a scalar quantity over a surface

I have a triangulated surface in the 3D space, represented by the following data structure: 'verts': array([[ 1.9499534e-01, 8.5202052e-04, -9.7121503e-03], [ 1.9499907e-01, 0.0000000e+00, -...
  • 4,549
-1 votes
0 answers
21 views

How do you create and average column in Tableau?

The details of my question can be found here: https://community.tableau.com/s/feed/0D58b0000Aic1rRCQQ When I select average it is just giving me the total.
  • 1
0 votes
0 answers
18 views

is average of total and the sum of average of group distribution the same

I have a query that calculates the total sessions and total number of crashed sessions. SELECT COUNT(*) count, SUM(cast((CAST((session.platform = 1 AND session.iscrashed) OR (session.platform ...
  • 3,701
0 votes
0 answers
14 views

Averaging across IDs (multiple responses) for multiple items [duplicate]

Does anyone know how to neatly average across item ID for multiple topics? Say I have five to fifteen responses (& I won't know how many unless I check them) for ID1-ID100, for which I want ...
  • 35
2 votes
2 answers
44 views

R Taking an average of a variable over intervals of another numeric variable

How would I go about calculating an average of column 2 for every x interval in column 1, when the number of rows for the intervals are not always equal? It seems very simple but I'm not sure where to ...
0 votes
0 answers
24 views

Average between two specific dates in dataframe equity close prices

I need some help with pandas .. i have a DataFrame containing Euro Stoxx 50 close prices from 2018-03-12 to 2025-10-31 (from today to 2020-10-31, i used Monte Carlo Simulation to generate some random ...
  • 1
0 votes
1 answer
62 views

average of "row"and "column" in list

I am trying to make an new list with the averages from every n row and column. my original list looks like this: \list = \[\[1,1,1,2,2,2,3,3,3\], \[4,4,4,5,5,5,6,6,6\], \[7,7,7,8,8,8,9,9,9\], \[0,0,0,...
1 vote
1 answer
21 views

Calculation of average of all possible slices of 1d-array

I have a (big) 1d array of measurement data. I want to calculate the average for every possible slice defined by a start-index and a stop-index. Like cutting at both ends of my data and average every ...
  • 13
0 votes
1 answer
24 views

Python : Find restaurants which satisfy conditions of mean and count

I have a dataset with information regarding restaurants, which cuisine type clients were looking for, prices of order, ratings among other columns. All restaurants have a rating between 1 and 5 (max)....
  • 1
-1 votes
3 answers
45 views

Im trying to write a function to get an average out of a table in python but I get an error saying 'List index out of range'

Im trying to make a function in python to find an average out of a table. In number_table there are 4 items so I put the count to 4. The error says : sum += table[i] IndexError: list index out of ...
0 votes
0 answers
25 views

Using AVG function with GROUP BY in BigQuery, and the result doesn't come out right

First I created table from the data set I imported, Using function PARSE_DATETIME to convert recorded date and time from a column called "ActivityMinute" in text string to DATETIME(...
  • 1
0 votes
2 answers
22 views

How to convert these Days into integers?

one question. I have a list under a column that looks like this: `[<36 * Days>, <23 * Days>] `` I would like to get only the values 36 and 23 as integers from this list (so that I can get ...
  • 11
0 votes
1 answer
33 views

What is the difference between rate() and avg_over_time() function in promethues?

I have a metric (Counter) to get number of calls from specific caller and would want to compare with average of last hour 7 and 14 days before for one hr. Which function should I use to calculate the ...
  • 471
0 votes
1 answer
36 views

When shoud I use numpy.mean and numpy.average?

I was studying statistical analysis in pandas and numpy and I came across numpy.average and numpy.mean I was wondering how numpy.average and numpy.mean are different. Are there any performance related ...
0 votes
1 answer
24 views

How to compute average value over the time spans?

I have some rows of data being actively logged to Application Insights. I would like to take the number of rows logged from the beginning of today till now and compare that to the average for the same ...
  • 1,975
0 votes
0 answers
24 views

It is possible to use result from sql aggregate function from other table as a field value in table? [duplicate]

I am trying to use result value from MySQL avg() function a field in other table, but i dont know how to do it. I was looking for similar questions but i didn't find any. That's how my database looks ...
  • 11
1 vote
1 answer
22 views

Average in SSRS table with grouping

Having difficulty with SSRS and the tablix setup, but it has been tough to find an answer looking through SO. I have a SQL table with records that each have an industry as well as data. I am hoping to ...
0 votes
0 answers
10 views

NaN and NA produced when using describe_across function

I am trying to get some descriptive stats from my data, however, I keep on getting Nan and NA when I run the code. this is my code describe_across(mediation_df_total, variables = c(friendship, ...
0 votes
1 answer
52 views

Select average if day occured and does not find a date from column

I have a table of exchange rates that contain a day and a value column, where the first one is the day of the exchange rate and the other has the value of that day. Then I have another table which has ...
0 votes
1 answer
56 views

How to calculate mean values per values in other column in one PROC SQL query in SAS Enterprise Guide?

I have query in PROC SQL with result as table in SAS Enterprise Guide like below: My query: proc sql; create table work.my_table as select ID , COUNTRY , VALUE from library1.table1 ;quit; Result of ...
  • 2,120
0 votes
1 answer
28 views

How can I get the average number of days between changes in a variable over a period of time in R?

I have a dataset that has date and another variable (bank rate). Here is a snippet of the data: I want to calculate the average number of days between each consecutive change in Bank rate. For ...
-1 votes
1 answer
52 views

How can I calculate an average value within 6-month periods?

I have a CSV file in which there are multiple numerical fields. Trying to calculate averages for a variable for every 6 months across a 5 year period and output into a data frame. Note there are also ...
1 vote
1 answer
29 views

Find average for column all except current value

I have data like this where every row is a task that certain employee completed and how much time it took them. | employee | minutes | | -------- | -------- | emp1 35 emp1 65 emp2 ...
1 vote
1 answer
26 views

How do I get the average of the numbers in an array into a windows message box in Powershell?

I'm trying to get the average marks for a student to display in Windows message box prompt, after entering max 5 marks from 0-100 I want the average output to the prompt. The student mark list gives ...
0 votes
0 answers
13 views

Trend curve for a boiler power monotone

I would like to get a trend curve, or an average power curve over the year? Do you have any ideas on how to proceed? It's strange because trend curve looks like through data jumps back and forth when ...
  • 1
0 votes
0 answers
20 views

What group of functions are used to calculate the average of a dynamic range for a pivot table?

I am trying to find a group of functions that allows me to calculate the avarge of a dynamic range for a pivot table. I know I have to use Offset & Counta however even when I change the data it ...
1 vote
1 answer
41 views

finding the average of an entire column in sql

I am trying to create a table includes the overall average rating and the seller's average rating. I have gotten the seller's rating, but not the overall rating. attached is also a sample of the table;...
0 votes
1 answer
26 views

How to calculate average with calculation two times in PowerBI using DAX?

I would like to calculate an average of a row with some condition. I tried this way: AVG = SWITCH( TRUE() ,'Backlog items'[ORU]<>"X", 'Backlog items'[Close Date]=TRUE(), (...
  • 764
-1 votes
2 answers
28 views

Rolling Average Excel

I am trying to find an average function that is able to automatically update when data is added in the row. For Example: If I have to phases of data 1 & 2. 1, has less data the 2 how do I find the ...
0 votes
1 answer
32 views

Python using pandas to take average of same lon/lat value pairs

I am using an extremely large dataset with around 1.6 million individual entries for the timespan I am trying to observe (1948 - 1960). An example of my dataset loaded into pandas before attempting to ...
  • 1
-1 votes
2 answers
60 views

We need to find the average of the column in pandas

time1 x y z GMT- 5 key time2 a b c GMT cut_off time_diff new_column 1 1.674841e+09 -1.10 64.11 ...

1
2 3 4 5
115