Questions tagged [deviation]
98 questions
2
votes
1 answer
Calculating Covariance Matrix of Two Distributions In Python
I would like to calculate the Covariance matrix of two distributions, what could be the possible ways to calculate them in python?

pacodelumberg
- 2,214
- 4
- 25
- 32
2
votes
3 answers
How to implement a loop over all columns within a calculation in pandas?
I'm new to pandas and python and I'm struggling with the implementation of loops in my code. I hope that someone can help me.
I have the following Dataframe:
import pandas as pd
from pandas import Timestamp
pd.DataFrame({'DateTime': {0:…

Kats
- 71
- 6
2
votes
2 answers
Python Matplot Y Axis Negative to Positive Label Range
I'm trying to create y axis labels in a sequence of -20 to + 20 with 5 integer increments. I've tried this below with my plot axis = ax2:
ax2.set_yticks(list(range(-20, 25, 5)))
ax2.set_yticklabels([abs(y) for y in list(range(-20, 25, 5))])
and I…

user2100039
- 1,280
- 2
- 16
- 31
2
votes
2 answers
Standard deviation calculation - Am I following the right approach? How do we find SD percentage?
I have a query which gives me below data.
item_name, total_purchase_count_per_week, previous_day_purchase_count.
For ex,
iPhone , 4800, 200
Samsung, 3000, 470
Moto, 1700, 80
Now, I'm interested in knowing how much percentage yesterday's purchase…

CuriousToLearn
- 153
- 1
- 12
2
votes
2 answers
Need guidance with logic programming in Python
I have been struggling to create 2 very small logic applications in Python. I am very new to programming and could definitely use some of your guidance, as this would possibly be very easy to someone with experience.
The first is a small program…

Daren P
- 21
- 2
2
votes
2 answers
Numpy: evaluation of standard deviation of values above/below the average
I want to calculate the standard deviation for values below and above the average of a matrix of n_par parameters and n_sample samples. The fastest way I found so far is:
stdleft = numpy.zeros_like(mean)
for jpar in xrange(mean.shape[1]):
…

mcave
- 121
- 2
- 7
2
votes
1 answer
Standard deviation between specific value and last value in a column
I would like to calculate the standard deviation of a population of many values, while the last value changes daily. Therefore, I would like to specify the range for the calculation from field G21 to whatever the last value in column G is.
I have…

user3333198
- 105
- 1
- 4
- 15
2
votes
3 answers
mean and standard deviation by group for multiple variables
I am sure this question has been answered before, but I would like to caclulate mean and sd by treatment for multiple variables (100s) all at once and cannot figure out how to do it aside from using a long winded ddply code.
This is a portion of my…

user2296772
- 23
- 1
- 1
- 5
1
vote
1 answer
.NET / C# arithmetic deviation (addition)
Summation of these numbers give different results in .NET Core / C# and on other compilers.
3987908.698692091 + 92933945.11382028 + 208218.11919727124 + 61185833.06829034
.NET Core / C# : 158315904.99999997
Others: 158315905
Clearly the .NET Core /…

user818117
- 420
- 1
- 5
- 15
1
vote
1 answer
Cumulative Deviation of 2 Columns in Pandas DF
I have a rather simple request and have not found a suitable solution online. I have a DF that looks like this below and I need to find the cumulative deviation as shown in a new column to the DF. My DF looks like this:
year month Curr Yr…

user2100039
- 1,280
- 2
- 16
- 31
1
vote
1 answer
Mean and Standard deviation of interpolated datasets (R)
I have 8 data sets that I have interpolated so the x axis spacing is the same but they are different lengths ranging from 800-1200 points.
What I would like to do is then calculate the mean of each y value and the standard deviation. Ideally there…

James Blackwell
- 29
- 9
1
vote
2 answers
Place different items evenly in array
I'm wondering if it is possible to somehow "sort" items in an array to place them in "equal" spacings.
An example is more than hundreds of words so:
Apple - 1
Banana - 2
Pineapple - 3
Orange - 4
And this is an array:
[ 'Apple', 'Apple', 'Banana',…

John Doe
- 23
- 4
1
vote
2 answers
Problem finding standard deviation and population variance correctly using Fortran
I couldn't find much when I searched for standard deviations and population variances on fortran 95. So I'm wondering if someone could help me? Thanks for your time.
Here is what I did, it compiled fine but it turned out giving wrong values:
…

EuropaDust
- 333
- 4
- 12
1
vote
1 answer
Hmisc wtd.var confusion: calculated weighted variance in R
I'm trying to calculate a weighted variance for a group of studies in a meta analysis for which I have individual means and variances:
variance #available variance values for studies
[1] 0.705600 NA 2.102500 0.672400 0.980100 0.494209 …

Ferdi
- 11
- 2
1
vote
2 answers
how to compute standard deviation in sql without built-in function
I have a column of numbers in my database. How can I computer the standard deviation? I do not want use the stddev function.

tonny
- 37
- 1
- 4