weighted-average Questions
6
Solved
Thanks for your responses. Yes, I was looking for the weighted average.
rate = [14.424, 14.421, 14.417, 14.413, 14.41]
amount = [3058.0, 8826.0, 56705.0, 30657.0, 12984.0]
I want the weighted ave...
Cataplasia asked 29/3, 2015 at 15:9
4
Solved
Issues regarding the command by and weighted.mean already exist but none was able to help solving my problem. I am new to R and am more used to data mining language than programming.
I have a data...
Sesquioxide asked 21/7, 2016 at 16:5
9
I want to implement an iterative algorithm, which calculates weighted average. The specific weight law does not matter, but it should be close to 1 for the newest values and close to 0 to the oldes...
Theophany asked 28/3, 2012 at 21:7
6
I want to apply a weighted rolling average to a large timeseries, set up as a pandas dataframe, where the weights are different for each day. Here's a subset of the dataframe
DF:
Date v_std vert...
Management asked 13/11, 2017 at 16:23
3
How do I compute the weighted mean in R?
For example, I have 4 elements of which 1 element is of size (or: length, width, etc.) 10 and 3 elements are of size 2.
> z = data.frame(count=c(1,3)...
Screen asked 12/6, 2012 at 0:6
13
Solved
I need to calculate 5-star ratings like the one on Amazon website. I have done enough search to find what is the best algorithm, but I am not able to get a proper answer. For example, if these are ...
Levitus asked 17/4, 2012 at 18:6
2
Solved
Creating a lambda function to calculate weighted average and sending that to a dictionary.
wm = lambda x: np.average(x, weights=df.loc[x.index, 'WEIGHTS'])
# Define a dictionary with the functio...
Septarium asked 16/4, 2018 at 19:15
5
Solved
Lets assume:
List<element> which element is:
public class Element {
int Weight { get; set; }
}
What I want to achieve is, select an element randomly by the weight.
For example:
Element_1.We...
Horrified asked 4/2, 2012 at 14:34
5
Solved
I have a time-series in a Pandas DataFrame. The timestamps can be uneven (one every 1-5 minutes), but there will always be one every 5 minutes (timestamps with minutes ending in 0,5,10,15,20,25,30,...
Pedigree asked 4/9, 2017 at 3:52
2
I know this must be super easy, but I'm having trouble finding the right dplyr commands to do this. Let's say I want to group a dataset by two variables, and then summarize the count for each row. ...
Extravagancy asked 24/4, 2018 at 1:15
2
I have a dataframe that looks like the one below.
The weight column essentially represents the frequency of each item, so that for each location the weight sum will equal to 1
Please keep in mind t...
Malcah asked 31/10, 2021 at 3:27
1
Solved
I'm trying to get average stock prices from a dynamic list.
In my example, I've made a bought stocks in a few different days. And I've sold some of them (not all). So, I have some stocks available ...
Subspecies asked 13/2, 2021 at 18:43
0
I am trying to reconstruct an image for which I know the values are floating-point pixel positions. I'm using scipy.interpolate.griddata() to interpolate the values at each integer location and rec...
Allegorist asked 11/1, 2021 at 8:37
3
I am trying to write code to find the mean of the keys in my dict, but based on the dict values. So, for example, for:
d = {1:2, 2:1, 3:2}
the dict keys would be:
[1,1,2,3,3]
I've written the fol...
Consensus asked 14/11, 2020 at 17:58
3
I need to provide a weighted sort on 2+ factors, ordered by "relevancy". However, the factors aren't completely isolated, in that I want one or more of the factors to affect the "urgency" (weight) ...
Stoker asked 6/1, 2012 at 15:57
1
Solved
I have two Pytorch tensors of the form [y11, y12] and [y21, y22]. How do I get the weighted mean of the two tensors?
Debroahdebs asked 28/7, 2020 at 7:0
3
Solved
I have an array:
In [37]: bias_2e13 # our array
Out[37]:
[1.7277990734072355,
1.9718263893212737,
2.469657573252167,
2.869022991373125,
3.314720313010104,
4.232269039271717]
The error on e...
Reedy asked 7/7, 2016 at 8:50
2
Assume I have a vector of grades, where the grade is
struct Grade{
const int grade;
const int ECTS; // weight
};
Is there a STL/range-v3 algorithm/algorithms that enable me to do this?
I know...
Linger asked 29/8, 2019 at 15:47
4
Solved
I have a matrix with shape (64,17) correspond to time & latitude. I want to take a weighted latitude average, which I know np.average can do because, unlike np.nanmean, which I used to average ...
Exobiology asked 2/3, 2016 at 21:12
4
I have a dataframe with a column of weights and one of values. I'd need:
to discretise weights and, for each interval of weights, plot the
weighted average of values, then
to extend the same logi...
Coursing asked 1/4, 2019 at 22:8
3
Solved
I implemented exponentially weighted moving average (ewma) in python3 and in Haskell (compiled). It takes about the same time. However when this function is applied twice, haskell version slows dow...
Belshazzar asked 17/2, 2017 at 10:29
1
Solved
Youtube provides two sorting options: Newest first and Top comments. The "Newest first" is pretty simple that we just sort the comments by their post date. But the "Top comments" seems to be ...
Trigeminal asked 5/1, 2015 at 14:38
1
Solved
I have te following pandas dataframe:
data_df = pd.DataFrame({'ind':['la','p','la','la','p','g','g','la'],
'dist':[10.,5.,7.,8.,7.,2.,5.,3.],
'diff':[0.54,3.2,8.6,7.2,2.1,1.,3.5,4.5],
'cas':[1....
Nebo asked 11/11, 2015 at 18:55
2
I have the following dataset (simple version of my actual data), 'data', and would like to calculate weighted means for variables x1 and x2, using weightings w1 and w2 respectively, split up into t...
Hom asked 11/6, 2015 at 4:50
1
Solved
I have several weighted values for which I am taking a weighted average. I want to calculate a weighted standard deviation using the weighted values and weighted average. How would I modify the typ...
Dread asked 21/5, 2015 at 20:0
1 Next >
© 2022 - 2025 — McMap. All rights reserved.