WeaselFox
WeaselFox

Reputation: 7400

deprecation warning in numpy

I have a script running scikit Naive Bayes classification, that I wrote on a linux machine. when I transport it to a windows machine, I get a deprecation warning:

DeprecationWarning: Implicitly casting between incompatible kinds...

in the linux version I have numpy version 1.6.1 and in windows numpy version is 1.7.1rc1.

It throws the warning when casting a list of floats to a 2d array. Should I ignore the warning? Does it have to do with the change in numpy version?

The casting seems to work ok in both machines...

Thanks

Upvotes: 2

Views: 3920

Answers (1)

Eike
Eike

Reputation: 2223

You should of course update your code so that the warning goes away. Maybe by explicitly creating a Numpy array from the list.

I suppose with casting you mean some automatic conversion like:

array([1., 2, 3]) * [3, 4, 5]

Responsible seems to be the following pull request, that was merged relatively recently. The best explanation is in file test_ufunc.py.

https://github.com/numpy/numpy/pull/451/files

Upvotes: 5

Related Questions