Questions tagged [mean]

The arithmetic mean (or simply the mean or average when the context is clear) is the central tendency of a collection of numbers. The mean is calculated as the sum of the numbers divided by the size of the collection.

The arithmetic mean, or simply the mean or when the context is clear, is the central tendency of a collection of numbers. The mean is calculated as the sum of the numbers divided by the size of the collection. Besides the arithmetic mean, the geometric mean and the harmonic mean can be calculated as well.

Means apply an equal weight to every member of a collection of numbers. This feature makes means not robust to outlier members. cf.

Source: Wikipedia

3925 questions
1
vote
1 answer

Pandas-mean along dataframe.index (hour, minute) for a dataframe with a large amount of data (months) (Python)

I´m want to analise the seasonal behaivor of temperature. The dataframe below shows 3 days of data (I have a year of data), so I'm trying to get a mean along the hour index, i.e. to obtain the mean between [2013-09-09 11:00:00+00:00, 2013-09-10…
nandhos
  • 681
  • 2
  • 16
  • 31
1
vote
1 answer

More elegant way of finding the mean of the rows in a matrix with julia

I have a 3x55 matrix of ints. I want to center each row around its mean. This gets the right answer, but it's ugly: row_mean = mean(points,[2]) points[1,:] = points[1,:] - row_mean[1] points[2,:] = points[2,:] - row_mean[2] points[3,:] =…
ashley
  • 1,535
  • 1
  • 14
  • 19
1
vote
1 answer

Integrate angularjs with node api?

I have my node routes as below // BASE SETUP // ============================================================================= // call the packages we need var express = require('express'); // call express var app = express(); …
sai chandesh
  • 91
  • 1
  • 7
1
vote
1 answer

How to test an Angular frontend that uses a MEAN stack API

First of all my, my project consists of two parts: an API and a frontend. My API is generated by the yeoman meanjs generator so it is built using the mean stack. The frontend is an angular project and generated using the yeoman angular…
1
vote
0 answers

How do I resume Yeoman generator script after an error?

I ran the official yeoman MEAN.JS generator and it failed to generate the app. The error was a wrong python version. I installed python 2.7.10 and would like to continue my build. What is the command to resume the build?
Surojit
  • 1,282
  • 14
  • 26
1
vote
0 answers

Passport.js error Unknown authentication strategy "local"

I use passport methods in code also, for example in registration in controller I use req.login(). And it works well - user is created without errors. But when I try to login with username and password of this user, I call passport and get the…
Drupal Noob
  • 153
  • 6
1
vote
4 answers

Read a .txt file, calculate sum and mean

I have a .txt file which contains numbers and looks like this: 1 2 3 etc The numbers are unimportant but they all start on a new line. I want to then find the sum & mean of the numbers in the text file. Here's what I have so…
Jack
  • 321
  • 2
  • 5
  • 16
1
vote
1 answer

How to use apply function in a filtered matrix column?

Create a matrix with (1) an indicator , (2) a condition and (3) a variable of interest x z<-rep(1:10,each=10) set.seed(974); cond=rbinom(100,3,0.5) set.seed(974) ; x=rnorm(100,1,10) All<-cbind(z,cond,x) ; All Using the whole dataset I can compute…
1
vote
1 answer

Determining Maximum and Mean of an User-Provided Array in Java

I am new to coding so be easy on me. I am trying to determine the maximum and mean of an user-provided array using two separate classes (i.e. xyz and a separate xyztester class). I've have my coding but the maximum output is 0.0 and the mean output…
new2coding
  • 11
  • 3
1
vote
1 answer

Plotting two sets of mean and standard deviation (using errbar)

I have used errbar to produce a figure in R showing mean and standard deviation. Here is my code errbar(data$Type, data$Mean,data$Mean+data$Std,data$Mean-data$Std, xlab="Type",ylab="Score", ylim=c(0,10)) which produces a plot of mean and…
lily23
  • 79
  • 1
  • 13
1
vote
1 answer

Calculating mean AND sum for values in a dataframe

DATETIME MAX.TEMP MIN.TEMP NEW.PRCP NEW.SNOW 18791 1999/03/20 06:00 0.4 -2.0 0 0.0 18911 1999/03/20 18:00 11.7 -1.5 0 0.0 19031 1999/03/21 06:00 6.9 2.0 -1 0.1 19151…
Bret Shandro
  • 61
  • 1
  • 9
1
vote
1 answer

matlab code to prompt a user for input inside a loop

I was asked to write a matlab code to calculate the mean of 5 numbers utilizing a loop structure, I wrote this code but I was wondering if I could do something to make matlab ask me to enter the values in order 1 to 5, for example " Enter Value 1…
1
vote
2 answers

Calculating a mean, but leaving numbers of unique variables

I'm struggling a bit with R and plyr, I don't know how to obtain the result I'm interested in. I have a dataframe looking like this: Region Price Alentejano 71 Andalucia 30 Bordeaux 135 Bordeaux 500 Bordeaux 185 And so on. I would like to get the…
Martin Andersen
  • 133
  • 1
  • 1
  • 7
1
vote
1 answer

I'm getting the error "return binding.PBKDF2(password, salt, iterations, keylen, callback); ^ TypeError: Not a buffer"

See the full error code below: crypto.js:601 return binding.PBKDF2(password, salt, iterations, keylen, callback); ^ TypeError: Not a buffer at pbkdf2 (crypto.js:601:20) at Object.exports.pbkdf2Sync (crypto.js:592:10) …
1
vote
0 answers

MEAN : Getting 500 Error while trying to register a user in Flapper news example

I am tying to learn MEAN Stack and trying to create a app for Flapper news as given in one of the site. I am trying to create a register and login functionality using passport. But when i am trying to register a user it returns a 500 Internal Server…
1 2 3
99
100