【问题标题】:Interpolate doesn't work for numpy percentile插值不适用于 numpy 百分位数
【发布时间】:2015-04-10 03:14:24
【问题描述】:

我在使用 np.percentile 时尝试使用中点插值,但它给了我错误: TypeError: percentile() 得到了一个意外的关键字参数“插值” 有没有办法解决这个问题?

【问题讨论】:

    标签: python numpy percentile


    【解决方案1】:

    the documentation of np.percentile 中提到 interpolation 参数是在 Numpy 版本 1.9.0 中添加的。根据错误信息,我认为您需要升级。

    【讨论】:

    • 感谢我更新到新版本并修复了它。
    • 我的版本为 1.11.0,我收到此错误,仅适用于 quantile 函数,而不是 percentile 函数。还有其他想法吗?
    • NVM。想通了:pandas 的旧版本。切换到numpy.percentile 并且成功了。
    猜你喜欢
    • 2014-09-06
    • 1970-01-01
    • 2020-07-16
    • 2018-07-25
    • 2014-03-17
    • 2019-06-08
    • 2020-08-07
    • 2011-01-23
    • 2013-11-11
    相关资源
    最近更新 更多