Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

大神报这个错:DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use array.size > 0 to check that an array is not empty. #19

Open
fengt12 opened this issue Jun 2, 2018 · 1 comment

Comments

@fengt12
Copy link

fengt12 commented Jun 2, 2018

大神,请教个问题,clf.predict的时候报错:
DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use array.size > 0 to check that an array is not empty.

会是什么原因呢,刚接触不是很懂,能否指点下

@cerebrumaize
Copy link

1.这是warning不是error啦.
2.在判断某个叫array的列表是否为空时,if array: ***以前可行,现在会被numpy提醒不要再这样做,判断该array是否是个空空列表要看array的size属性,而不是判断对象是否存在.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants