I couldn't remember if np.zeros(x)
will automatically covert a float x
to int or not, so I tried it in IDLE. What I got the first time was a Warning message that refers to the script I had run earlier in the same session, and then warns me "using a non-integer number instead of an integer will result in an error in the future".
I tried it again, and the warning did not repeat, and the array was instantiated as expected with dtype=float
.
Why does the warning say there will be an error (as opposed to could be), and what will it be? And why did it refer to the first non-blank line in the script I'd run much earlier today get embedded into the warning?
This may be a window into how IDLE is working - so I'm hoping to learn something from this. I've read here that I can suppress the warning, but I would like to understand it's behavior first.
>>>
>>> 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.])
>>>