Top "Mean" questions

The arithmetic mean (or simply the mean or average when the context is clear) is the central tendency of a collection of numbers.

pd.rolling_mean becoming deprecated - alternatives for ndarrays

EDIT: This question was asked in 2016 and similar questions have been posted on SO years later after the functionality was …

python numpy pandas scipy mean
Pandas: Impute NaN's

I have an incomplete dataframe, incomplete_df, as below. I want to impute the missing amounts with the average amount …

python pandas nan dataframe mean
Finding the mean and standard deviation of a timedelta object in pandas df

I would like to calculate the mean and standard deviation of a timedelta by bank from a dataframe with two …

python pandas datetime mean timedelta
Create an array with a pre determined mean and standard deviation

I am attempting to create an array with a predetermined mean and standard deviation value using Numpy. The array needs …

python arrays numpy mean
How exactly are outliers removed in R boxplot and how can the same outliers be removed for further calculation (e.g. mean)?

In a boxplot I've set the option outline=FALSE to remove the outliers. Now I'd like to include points that …

r mean outliers
Panda dataframe conditional .mean() depending on values in certain column

I'm trying to create a new column which returns the mean of values from an existing column in the same …

python pandas conditional mean
Weighted mean in numpy/python

I have a big continuous array of values that ranges from (-100, 100) Now for this array I want to calculate …

python numpy statistics mean weighted
How to create mean and s.d. columns in data.table

The following code/outcome baffles me as to why data.table returns NA for the mean functions and not the …

r data.table mean calculated-columns
Dealing with NAs when calculating mean (summarize_each) on group_by

I have a data frame md: md <- data.frame(x = c(3,5,4,5,3,5), y = c(5,5,5,4,4,1), z = c(1,3,4,3,5,5), device1 = c("c","…

r dplyr mean na
Sort boxplot by mean (and not median) in R

I have a simple boxplot, showing the distribution of a score for factor TYPE: myDataFrame = data.frame( TYPE=c("a","…

r sorting boxplot mean