Weighted mean
#1049
Replies: 2 comments 1 reply
-
weirdly, i don't think i've ever done this. It should probably be added as a function. Here's some code that does it. I put in a bunch of println statements so you can see the results being built.
And here's the output:
Note that any columnwise math returns results as DoubleColumn. |
Beta Was this translation helpful? Give feedback.
1 reply
-
it's probably possible, but not on the existing summarization framework. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I would like to know how to calculate the weighted mean with Tablesaw. For instance, for the following table:
Name ItemCost Quantity
A 13 3
A 7 2
B 9 2
I would like the result
Name Weigthedmean
A 10.6
B 9
Of course, other weighted statistics (such as Std Dev etc) are also of interest!
Thanks for any suggestion!
Beta Was this translation helpful? Give feedback.
All reactions