在 python 中,我可以使用 python 来做到这一点,如 How do I calculate percentiles with python/numpy?
import numpy as np
a = np.array([1,2,3,4,5])
p = np.percentile(a, 50)
我想知道2018年用Ruby计算百分位有什么方便的方法?
最佳答案
就是几行函数,2018开发者可以自己写。 但是你可以查看descriptive_statistics gem 。
require 'descriptive_statistics'
data = [1,2,3,4,5]
data.percentile(50)
关于ruby - 在 Ruby 中使用什么 gem 来计算百分位数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49219039/