I could not remember if np.zeros(x) automatically hide float x to int or not, so I tried it in IDLE. The first thing I got was a “Warning” message, which refers to a script that I used earlier in the same session, and then warns me “using a non-integer instead of an integer will lead to an error in the future”.
I tried again and the warning did not repeat, and the array was created as expected using dtype=float .
Why does the warning say that there will be an error (as opposed to what may be), and what will it be? And why did he refer to the first non-empty line in the script that I would run much earlier, insert it into the warning today?
It may be the window that IDLE is running in, so I hope to learn some of this. I read here that I can suppress the warning, but first I would like to understand its behavior.
>>> >>> equator = np.zeros(3.14) Warning (from warnings module): File "/Users/xxxxxx/Documents/xxxxxx/CYGNSS/CYGNSS TLE interpolator v00.py", line 2 CYGNSS_BLOB = """1 41884U 16078A 16350.61686218 -.00000033 00000-0 00000+0 0 9996 VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future >>> >>> equator = np.zeros(3.14) >>> equator array([ 0., 0., 0.]) >>>
source share