[转载] sklearn FutureWarning: numpy not_equal will not check..., The comparison did not return the sam

在Ubuntu系统上使用Python2.7时,导入sklearn库出现FutureWarning,提示numpy的不等于操作符在未来版本中将改变行为。该警告源于numpy的not_equal函数对于特定类型比较的未来变更。为消除警告,建议通过pip更新numpy到1.16.1版本。
摘要由CSDN通过智能技术生成

参考链接: Python中的numpy.not_equal

1. 问题 

import sklearn 后有如下警告 

ubuntu@test:/data/# python

Python 2.7.12 (default, Nov 12 2018, 14:36:49)

[GCC 5.4.0 20160609] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> import sklearn

/usr/local/lib/python2.7/dist-packages/sklearn/utils/fixes.py:313: FutureWarning: numpy not_equal will not check object identity in the future. The comparison did not return the same result as suggested by the identity (`is`)) and will change.

  _nan_object_mask = _nan_object_array != _nan_object_array

>>> import sklearn

>>> sklearn.__version__

'0.20.0'

>>> exit()

 

2. 解决方法 

sudo pip uninstall numpy

sudo pip install numpy==1.16.1

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值