【发布时间】:2015-04-10 03:14:24
【问题描述】:
我在使用 np.percentile 时尝试使用中点插值,但它给了我错误: TypeError: percentile() 得到了一个意外的关键字参数“插值” 有没有办法解决这个问题?
【问题讨论】:
标签: python numpy percentile
我在使用 np.percentile 时尝试使用中点插值,但它给了我错误: TypeError: percentile() 得到了一个意外的关键字参数“插值” 有没有办法解决这个问题?
【问题讨论】:
标签: python numpy percentile
the documentation of np.percentile 中提到 interpolation 参数是在 Numpy 版本 1.9.0 中添加的。根据错误信息,我认为您需要升级。
【讨论】:
quantile 函数,而不是 percentile 函数。还有其他想法吗?
pandas 的旧版本。切换到numpy.percentile 并且成功了。