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.

In the most common case, the data set is a list of numbers. The average of a list of numbers is a single number intended to typify the numbers in the list. If all the numbers in the list are the same, then this number should be used. If the numbers are not the same, the average is calculated by combining the numbers from the list in a specific way and computing a single number as being the average of the list.

Many different descriptive statistics can be chosen as a measure of the central tendency of the data items. These include the arithmetic mean, the median, and the mode. Other statistics, such as the standard deviation and the range, are called measures of spread and describe how spread out the data is.

See also: , ,

5780 questions
1
vote
1 answer

List of items using count and average in MYSQL Workbench producing too few results

I have a list of book titles that I need to first count more than four copies per title (in alphabetical order), then total the book title and find the average price. However, my code only produces 1 book, instead of a list. This is what I need to…
ppines
  • 45
  • 8
1
vote
2 answers

Average of top 4 numbers greater than 0 Microsoft Excel

I am having trouble finding a formula that finds the top 4 numbers in a row that are all greater than 0, and if there are less than 4 numbers greater than 0 it finds the average of those numbers. example: A B C D E F G H 1 2 0 0 4 0 0 0 I…
1
vote
5 answers

Averaging values in array corresponding to the values of another array

I have an array that contains numbers that are distances, and another that represents certain values at that distance. How do I calculate the average of all the data at a fixed value of the distance? e.g distances (d): [1 1 14 6 1 12 14 6 6 7 4 3 7…
1
vote
2 answers

Weighted median in java

I'm trying to program a program to compute Weighted Median, but I have a small problem I couldn't solve. to find the Weighted Median, you have to divide each weight by the sum then compare it with 0.5 if greater means the Weighted Median found then…
LaLa
  • 101
  • 11
1
vote
3 answers

How to Calculate Average Scroll Depth?

I am trying to calculate the average scroll depth of a page on a website. In Google Analytics, I have events that fire at milestones of 10% increments—so when a user reaches 10% down the page, 20%, 30%, and so on. I have have a custom metrics for…
tefran
  • 45
  • 2
  • 7
1
vote
3 answers

Add averages to column for each group in PostgreSQL

I have a table which contains a list of repeated names, a score value, and a score type. How can I group by name, get the average of score value for each name for each score type, and add this average to a float column I've created called avg_score?…
Laurie
  • 1,189
  • 1
  • 12
  • 28
1
vote
2 answers

How to fix TypeError?

So I have thoutghly researched how to do this, but even then I am coming accross problems. It is one error after another. For example Traceback (most recent call last): File "C:/Users/Owner.OWNER-PC/AppData/Local/Programs/Python/Python37-32/lab 5…
1
vote
1 answer

Cannot get information from other functions in order to find 10 above and below average

Im trying to make 4 separate functions that create a random list of 10000 functions in a outfile then find the average of all the numbers in the range from 1 to 100 and then find how many numbers are above 10 and below 10 of the average. This is a…
1
vote
1 answer

Groupby more than1 columns and then average over another column

I have the follow dataset: cod date value 0 1O8 2015-01-01 00:00:00 2.1 1 1O8 2015-01-01 01:00:00 2.3 2 1O8 2015-01-01 02:00:00 3.5 3 1O8 2015-01-01 03:00:00 4.5 4 1O8 …
jjgasse
  • 319
  • 2
  • 5
  • 16
1
vote
1 answer

Swap values of two columns of dataframe if conditions apply (Python 3)

I want to calculate the average of countX for all rows that have similar address1 and address2 or for the cases where the address values are inverted. That is, address1=ad3 and address2=ad1 is similar to address1=ad1 and address2=ad3. For…
alejo
  • 127
  • 2
  • 11
1
vote
2 answers

How can I find AVG of a group in Hive and compare against it

I'm not sure the title explains my problem very well, I'll detail it correctly here. I have a table called 121_salaries which has columns empname, address, jobtitle, department and salary. I want to find the average salary of each job title, then…
Gus
  • 108
  • 9
1
vote
1 answer

Averaging every 10 numbers in a matrix in Matlab

How to get an average of every 10 numbers in a big matrix (27x16800). I can't find the solution If anyone could help that would be great. UPD Sorry, I should have been more clear. I have a matrix of recorded values (16800) for 27 subjects. Each…
1
vote
3 answers

The average value of a list, in chunks of 100 items

I have a text file in which I have, for example, 1084 elements. I list them. import csv a = [] with open('example.txt', 'r') as csvfile: file_name = csv.reader(csvfile, delimiter='\t') for row in file_name: …
Prap Prep
  • 23
  • 4
1
vote
4 answers

Finding the Average in a sequence of number in c while ignoring the negative numbers in the sequence

I have to write a C program that reads a sequence of integers (positive, negative, or zero) and calculate the average of the positive integers only. If there are no positive numbers, you should display the following statement followed by a new…
jrl
  • 27
  • 1
  • 5
1
vote
4 answers

Average of elements in a subarray

I have an array like a=[1, 2, 3, 4, 5, 6, 7]. I want to split this array into 3 chunks of any size. When I split this into 3 chunks, I get 3 subarrays: [array([1, 2, 3]), array([4, 5]), array([6, 7])]. My goal is to get an array with the average of…
Hrihaan
  • 275
  • 5
  • 21