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.

average
Filter by
Sorted by
Tagged with
-1 votes
3 answers
91 views

Is there a way to calculate a multiple moving averages based on an ID and data frame in R?

I am analyzing data and would like to calculate many moving averages at once. I will past here an example of what I am trying to do. Table 1: IDs and Day IDDate <- data.frame(ID = c("A",&...
Wayne Schmitt's user avatar
0 votes
1 answer
52 views

creating a loop for a simulation with linked variables in r

I'm simulating species richness based on extinction and speciation rates using the sim.bd function from the geiger package. I need to run the simulation 1000 times. When you run it once you get 3 ...
Georgia H's user avatar
4 votes
2 answers
139 views

Subtracting random number does not match average I should get

Suppose you organize a competition with 25 million participants. At each round, a random number from the people remaining is eliminated. How many rounds should we expect to get 5 participants or less ?...
Kilkik's user avatar
  • 181
4 votes
3 answers
122 views

How do I calculate the sum and the average of all values in a python dict by key name? [closed]

I have a dict object from which I want to calculate the sum and the mean of specific named values. Setup: tree_str = """{ 'trees': [ { 'tree_idx': 0, ...
skeetastax's user avatar
  • 1,300
-1 votes
1 answer
61 views

How to get average and total with the program I am building

I need to write a program in Python that utilizes a loop to read a set of five values from user input and print the following: total, average, maximum, minimum and interest at 20%. I also need to ...
RylieAnya's user avatar
0 votes
0 answers
25 views

How to omit data from an array return

=ARRAYFORMULA(AVERAGE(ABS(L52:M100))) Some of the data is 0 so it is affecting the calculation. How do I omit the 0 data? Thanks
user avatar
0 votes
0 answers
156 views

Why is the accuracy of average="micro" the same as precision or recall in multi-class classification?

I have been studying multi-class classification metrics. In the process, I discovered that in the case of the parameter average='micro', accuracy, precision, recall, and the f-1 score are all the same....
MinjeSeok's user avatar
0 votes
0 answers
66 views

How do I calculate the time difference between two datetimes in excel and then get the average time?

I have a dataset that I download from an application (no movement in changing the format of data) **Created Date | Reviewed Date** 2023-10-25T09:55:47 | 2023-10-28T10:23:56 2023-10-25T09:55:47 ...
james's user avatar
  • 15
-1 votes
1 answer
61 views

Average of a list in Python

I have a file "list1" that contain Name, Surname, Note1, Note2, like this: DUPOND, John, 12, 10 JAMES, Fil, 8, 10 KYLE, Gregor, 17, 7 I want to write a Python script to display in another ...
yoyo348's user avatar
  • 11
0 votes
0 answers
36 views

Java get non uniform random numbers [duplicate]

I need to generate random data for a geocaching game. I've a list of QuestMeasurement with QuestId, StageId and measurement value. How can I generate random numbers that should have a different ...
Mendi Sterenfeld's user avatar
1 vote
1 answer
33 views

Intro to Python: how to find average of a single dictionary value ("model_year")

import csv #Informs Python that we want to use the csv module. vehicleInventory = {} with open('cars.csv', newline='') as csvfile: filereader = csv.DictReader(csvfile, delimiter = ',', quotechar ...
Conner Kristian Amano-Lee's user avatar
1 vote
2 answers
189 views

Averaging arrays over a grid in Python

I would like to average a d-dimensional array M of size NxNx...xN (d times) over a regular grid of step k, i.e. building a new array N of size NxNx...xN (d times) where in each hypercube H of the ...
BabaUtah's user avatar
0 votes
1 answer
210 views

To find Maximum Average Subarray

This is a Leetcode problem, You are given an integer array nums consisting of n elements, and an integer k. Find a contiguous subarray whose length is equal to k that has the maximum average value and ...
Bhoomika's user avatar
2 votes
2 answers
97 views

Error when calculating average scores with NumPy: 'ufunc add' did not contain a loop

I'm encountering an issue when trying to calculate the average scores of students using NumPy. The code I've written is giving me the following error: Traceback (most recent call last): ...
Kelsey Pettrone's user avatar
0 votes
0 answers
24 views

Average cells that are in a table based on info within another cell of the same table

I have a table created and I'm wanting to average the pH(total scale) column based on the date column, specifically by year. The dates range from 2011 to 2020, so I'm hoping for an average of pH from ...
Kitt Kroeger's user avatar
1 vote
1 answer
36 views

Can't display average in Tableau

I'm trying to display the average of movie ratings based on a common actor. When I drag and drop the "score" value in the columns, Tableau assumes I'm talking about SUMs and shows them ...
pedro's user avatar
  • 427
-1 votes
2 answers
134 views

SQL Average of duration (h:mm:ss)

I'd like to take the average of serveral durations (h:mm:ss) using SQL. So for instance 3:00:00 0:30:00 1:00:00 should average 1:30:00 -- (90min) I tried CASTing in various formats with no success. ...
salokin's user avatar
  • 11
0 votes
1 answer
36 views

SQL- Average all transactions that match id

I am using SQLite and attempting to find the average transaction price of a good by ID. I am attempting to update the A.avg_price with the average price of all transactions in the quarter for that ...
tspecht's user avatar
0 votes
0 answers
16 views

Column =Avg(Fields!Counts.Value) doesn't work

I'm trying to get a simple column average to work in SSRS(2016 I Believe). If I can't get the column average I'll settle for a correct row count (917) This doesn't work either =CountRows() This also ...
Heather Brouillette's user avatar
0 votes
0 answers
29 views

How to create an average, rank, total measures over a field (by dynamic period) in SSAS

I'm new with SSAS technology and I have an existing cube that measures hits by page on web site. In few words the cube is structured as followed: a dimension 'Expression' that contains reference to ...
Kariboon's user avatar
0 votes
1 answer
70 views

SQL incorrect difference calculation between a value and a column average

So I wrote a query to find a list of countries' GDP in 2022 with a difference from average GDP among them for each country. But when I checked the calculations, the difference values were wrong so i ...
norlingstax's user avatar
0 votes
1 answer
168 views

Using OpenCV face detection to obtain RGB pixels of a recorded video

I'm new to Python and currently studying about it. I'm currently using OpenCV haarcascade for facial detection (which has already been done) and is currently trying to obtain the RGB pixels of each ...
Brandon's user avatar
0 votes
1 answer
216 views

Calculating daily average count of each category in Spotfire when some categories do not appear on every day

I have a data table in Spotfire which has a list of items belonging to different management groups. Each management group gets new items every day. I want to calculate the daily average number of ...
cambry's user avatar
  • 3
-1 votes
2 answers
45 views

calculate mean values of weather data for each hour and day of the year based on historical data

I need to calculate average values of meteorological data for each day and hour of the year based on hourly historic data of 2015 - 2023 in r programming. The average hourly values will be used to ...
Iro's user avatar
  • 37
0 votes
2 answers
93 views

Best way to calculate growth rate with different timepoints

I have some data that looks like this I want to calculate growth rate of each tumor (cm/month) and then eventually calculate an average growth rate. I have previously done this manually for each time ...
user2930701's user avatar
0 votes
0 answers
18 views

So I'm trying to learn Dart/Flutter for the first time for my own project

new to Stack OF. I'm stuck on averages on Dartpad,it's not running the double average & I don't know why. I was watching YouTube tutorials, and it was working fine before with the average. However,...
user avatar
0 votes
1 answer
108 views

Calculating Average for a section

I am creating a Task list, and I have few stages. I have % done. in the picture below I want Cell J8 to calculate the average the to Stage 1 % Done which is between cell J9:J15, however, I want be ...
adavoodi's user avatar
0 votes
2 answers
77 views

Calculate average between mean and 1st standard deviation

I have an array: import numpy as np # Create an array of values values = np.array([41,17,44,36,14,29,33,38,49,39,22,15,46]) # Calculate the mean mean = np.mean(values) # Calculate the standard ...
Jose Luis Landivar S's user avatar
0 votes
0 answers
25 views

How to measure rate in telegraf using hot-shots

I am using hot-shots module in Node to send measurements to telegraf, which then sends data to influx db. I want to measure exact cache hit rate. My collection interval is 1s. I use gauge to store ...
dzuremar's user avatar
  • 170
0 votes
3 answers
116 views

Where am I going wrong? Trying to output average with awk

I am taking the following data and trying to output the average with awk. $ cat chores.csv Chore Name,Assigned to,estimate,done? Laundry,Chelsey,45,N Wash Windows,Sam,60,Y Mop kitchen,Sam,20,N Clean ...
CatScratch's user avatar
1 vote
2 answers
512 views

how to find AVG of time in snowflake

I have a timestamp column with following sample data: JOB_ID OOB_TIMESTAMP 1495576 NULL 1495576 2022-08-25 18:29:00.000 -0700 1495576 2022-08-24 19:56:00.000 -0700 1495576 2022-08-23 17:32:00.000 -...
deg's user avatar
  • 37
0 votes
3 answers
228 views

How to perform this average count per hour calculation in SQL?

A simplified version of my table looks like this: id hour 1 3 1 3 1 3 1 4 2 12 2 12 2 14 The hour column means 3am, 4am, 12pm etc. What I'd like to be able to do (working in Amazon Athena) is ...
Ted's user avatar
  • 1,233
0 votes
1 answer
73 views

SQL - Trouble with nested query - Need to average counts over a specified date range

I am having trouble getting a nested query to behave as I'd like in Microsoft SQL Server Management Studio 19 *. Here is what the base table looks like. Each entry represents an internal order of a ...
Bushmatic's user avatar
1 vote
1 answer
31 views

I need to get the average of 2 SQL query results in ASP.NET C#

I am trying to fetch some data using the count function in sql into my asp.net project in 3 parts: Part one will use the 1st SQL query as follows: select distict, shop_number, count(Emp_id) from ...
Hussain Mahdi Farhanian's user avatar
0 votes
1 answer
16 views

How can Apache IoTDB retain two decimal places of average value after query aggregation?

After query aggregation in Apache IoTDB, can average calculate avg retain two decimal places in IoTDB? If this can be done, what settings should I install? If this cannot be done, are there any other ...
NKZ's user avatar
  • 105
0 votes
1 answer
50 views

Calculate average of multiple numbers split by newline character

I am attempting to calculate the average of numbers split by newline character across multiple columns: ={"Average"; {""; IFERROR(ARRAY_CONSTRAIN(MAP(D3:D, E3:E, F3:F, G3:G, H3:H, ...
dan's user avatar
  • 349
0 votes
1 answer
34 views

How to create new column based on mean of specific window (number of rows)?

I have a dataframe like this: import pandas as pd import matplotlib.pyplot as plt df = pd.DataFrame({"ID":[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], "A":[30, 20, ...
user026's user avatar
  • 702
0 votes
1 answer
43 views

AVG(User_Score) in T-SQL is returning wrong value [closed]

I imported an Excel sheet into SMSS about video games, there are around 10,000 User_Scores, but when I run the code below it seems to only give me the max user_score per publisher... I was looking to ...
N-Night's user avatar
0 votes
0 answers
94 views

Power BI average of averages of averages DAX measure

I have datas seems like this : We have to calculate the averages of the column "value", however we have to follow the rule : "all component have the same weight in a product, all ...
Michiyo's user avatar
  • 29
-2 votes
1 answer
22 views

Need a formula for additional quantity needed at a set price to bring down cost avg to equal as close to said price

We have 3 transactions of an item purchased at different prices . The current market price is 10.00 for a total of 6 items with a cost avg of 33.33. (Total investment divided by Quantity) Is there a ...
jsunsnow's user avatar
0 votes
1 answer
37 views

How can add the average value of different categories in ggplot?

I want to add the mean values(text or vertical lines) for 4 categories (2 year * 2 treatments) when applying facet_wrap. I've already tried group_by, but it can only work on 2 categories (year or ...
Chouette's user avatar
  • 153
0 votes
3 answers
101 views

MAriadb optimizing query for averaging

I have database like this (in real there are over 30 different sKey): +----+------+------+---------------------+ |ID | sKey | sVal | timestamp | +----+------+------+---------------------+ | ...
eSlavko's user avatar
  • 348
1 vote
3 answers
63 views

How to add a new column in pandas data frame which calculates the average of top 5 values of each row for multiple rows

How to add a new column in pandas data frame which calculates the average of top 5 values of each row for multiple rows. import pandas as pd import random random.seed(0) df = pd.DataFrame({ 'A':...
srpollaa's user avatar
0 votes
4 answers
372 views

How do I Average the values across a row when some values might be Null? [duplicate]

long time listener, first time caller here... I am trying to use SQL to calculate the average of several values across a row. All suggestions I've seen thus far say to simply Sum the values and ...
Ginger's user avatar
  • 3
1 vote
2 answers
159 views

Change time format to be able to get correct average

I am trying to calculate the average time taken to complete a training program by the users. The report in Excel gives the times as 01h 13m 31s. I have 199 of these formatted times in a column. Some ...
Fred Frontino's user avatar
0 votes
0 answers
23 views

I want to take the input from the user and after storing the input in a list I want to calculate the average of all those numbers [duplicate]

numbers = input("give me al list of numbers: ") list_number = [] for i in numbers: if i.strip(" "): list_number.append(i) print(list_number) Up to here everything works, ...
Daniel Rodriguez's user avatar
0 votes
1 answer
36 views

Highcharts, calculate and draw average line on columns/scatter series

I use Highcharts to draw scatter series (representing different runs) on columns (representing years). I used the pointPlacement option to place the columns as I need series: [ { name: "Run 1&...
vegaelce's user avatar
  • 121
0 votes
0 answers
31 views

Excel: Averageifs from a table with columns

I have a tab with a table. The table has over 30 different item names that are taking the average of over 180 types of items as the columns and dates as the rows. The example is the column is Apples ...
Sahng's user avatar
  • 1
-2 votes
1 answer
67 views

May I ask where did I go wrong with my SQL query?

Question: My Query: SELECT first_name, last_name, ROUND(AVG(score), 2) AS avg_score FROM students WHERE test_name IN ('English Test', 'History Test') AND score >= 0.9 GROUP BY id, first_name,...
Mariz Papas's user avatar
0 votes
2 answers
103 views

Power BI - Calculating average with multiple filters

I want to calculate the average of monthly values, based on the filtered names and months. I have a table like this: Table It should be the average of the values of the two month periods of the ...
DorottyaB.H.'s user avatar