<div dir="ltr"><div>I'm trying to fix some code in statsmodels that creates Deprecation Warnings from numpy</div><div><br></div><div>Most of it are quite easy to fix, mainly cases where we use floats to avoid integer division</div><div><br></div><div>I have two problems</div><div><br></div><div>first, I get Deprecation warnings in the test run that don't specify where they happen.</div><div>I try to find them with file searches, but I don't see a `np.ones` that might cause a problem </div><div>(needle in a haystack: Close to 4000 unittests and more than 100,000 lines of numpython)</div><div>Also, I'm not sure the warnings are only from statsmodels, they could be in numpy, scipy or pandas, couldn't they?</div><div><br></div><div><br></div><div>second, what's wrong with non-integers in `np.r_[[np.nan] * head, x, [np.nan] * tail]` (see below)</div><div><br></div><div>I tried to set the warnings filter to `error` but then Python itself errored right away.</div><div><br></div><div><a href="https://travis-ci.org/statsmodels/statsmodels/jobs/68748936">https://travis-ci.org/statsmodels/statsmodels/jobs/68748936</a><br></div><div><a href="https://github.com/statsmodels/statsmodels/issues/2480">https://github.com/statsmodels/statsmodels/issues/2480</a><br></div><div><br></div><div><br></div><div>Thanks for any clues</div><div><br></div><div>Josef</div><div><br></div><div><br></div><div>>nosetests  -s --pdb-failures --pdb "M:\j\statsmodels\statsmodels_py34\statsmodels\tsa\tests"</div><div><br></div><div>..................C:\WinPython-64bit-3.4.3.1\python-3.4.3.amd64\lib\sit</div><div>e-packages\numpy\core\numeric.py:183: DeprecationWarning: using a non-integer nu</div><div>mber instead of an integer will result in an error in the future</div><div>  a = empty(shape, dtype, order)</div><div>..........</div><div><br></div><div><br></div><div>.......M:\j\statsmodels\stat</div><div>smodels_py34\statsmodels\tsa\filters\filtertools.py:28: DeprecationWarning: usin</div><div>g a non-integer number instead of an integer will result in an error in the futu</div><div>re</div><div>  return np.r_[[np.nan] * head, x, [np.nan] * tail]</div><div>..........................</div><div><br></div><div><br></div><div>...................C:\WinPython-64bit-3.4.3.1</div><div>\python-3.4.3.amd64\lib\site-packages\numpy\lib\twodim_base.py:231: DeprecationW</div><div>arning: using a non-integer number instead of an integer will result in an error</div><div> in the future</div><div>  m = zeros((N, M), dtype=dtype)</div><div>C:\WinPython-64bit-3.4.3.1\python-3.4.3.amd64\lib\site-packages\numpy\l</div><div>ib\twodim_base.py:238: DeprecationWarning: using a non-integer number instead of</div><div> an integer will result in an error in the future</div><div>  m[:M-k].flat[i::M+1] = 1</div><div>...........</div><div><br></div><div><br></div></div>