<p dir="auto">I recently upgraded to the latest version of numpy (1.18.1) and matplotlib (3.2.1). My python script was performing fine prior to the upgrade and now, it's hit with error messages. I'm running on python version 3.7.7. Below is the error message.</p>
<h3 dir="auto">Error message:</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;C:\AppData\Local\Continuum\anaconda3\lib\site-packages\numpy\core\function_base.py&quot;, line 117, in linspace
    num = operator.index(num)
TypeError: 'float' object cannot be interpreted as an integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File &quot;work5.py&quot;, line 435, in &lt;module&gt;
    readdata()
  File &quot;work5.py&quot;, line 92, in readdata
    h, xh, yh = np.histogram2d(totals, psd, (NGbinNum,PSDbinNum), range = [ x_range, y_range ] )
  File &quot;&lt;__array_function__ internals&gt;&quot;, line 6, in histogram2d
  File &quot;C:\AppData\Local\Continuum\anaconda3\lib\site-packages\numpy\lib\twodim_base.py&quot;, line 715, in histogram2d
    hist, edges = histogramdd([x, y], bins, range, normed, weights, density)
  File &quot;&lt;__array_function__ internals&gt;&quot;, line 6, in histogramdd
  File &quot;C:\AppData\Local\Continuum\anaconda3\lib\site-packages\numpy\lib\histograms.py&quot;, line 1053, in histogramdd
    edges[i] = np.linspace(smin, smax, bins[i] + 1)
  File &quot;&lt;__array_function__ internals&gt;&quot;, line 6, in linspace
  File &quot;C:\AppData\Local\Continuum\anaconda3\lib\site-packages\numpy\core\function_base.py&quot;, line 121, in linspace
    .format(type(num)))
TypeError: object of type &lt;class 'float'&gt; cannot be safely interpreted as an integer."><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
  File "C:\AppData\Local\Continuum\anaconda3\lib\site-packages\numpy\core\function_base.py", line 117, in linspace
    num = operator.index(num)
TypeError: 'float' object cannot be interpreted as an integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "work5.py", line 435, in &lt;module&gt;
    readdata()
  File "work5.py", line 92, in readdata
    h, xh, yh = np.histogram2d(totals, psd, (NGbinNum,PSDbinNum), range = [ x_range, y_range ] )
  File "&lt;__array_function__ internals&gt;", line 6, in histogram2d
  File "C:\AppData\Local\Continuum\anaconda3\lib\site-packages\numpy\lib\twodim_base.py", line 715, in histogram2d
    hist, edges = histogramdd([x, y], bins, range, normed, weights, density)
  File "&lt;__array_function__ internals&gt;", line 6, in histogramdd
  File "C:\AppData\Local\Continuum\anaconda3\lib\site-packages\numpy\lib\histograms.py", line 1053, in histogramdd
    edges[i] = np.linspace(smin, smax, bins[i] + 1)
  File "&lt;__array_function__ internals&gt;", line 6, in linspace
  File "C:\AppData\Local\Continuum\anaconda3\lib\site-packages\numpy\core\function_base.py", line 121, in linspace
    .format(type(num)))
TypeError: object of type &lt;class 'float'&gt; cannot be safely interpreted as an integer.
</code></pre></div>
<p dir="auto"><code class="notranslate">linspace()</code> has always converted floats to integers for the <code class="notranslate">num=</code> kwarg (for as long as I can remember). But now I'm getting a TypeError with 1.18.1. This is breaking lots of downstream code and isn't too hard to fix but is rather annoying. I'm submitting this because there seemed to be no deprecation warning for this change. Ideally things like this would have year long deprecation cycles (at least).</p>
<h3 dir="auto">Reproducing code example:</h3>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(numpy1.17) moorepants@garuda:four_bar_linkage(master)$ python
Python 3.8.2 | packaged by conda-forge | (default, Mar 23 2020, 18:16:37) 
[GCC 7.3.0] on linux
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&gt;&gt;&gt; import numpy as np
&gt;&gt;&gt; np.__version__
'1.17.5'
&gt;&gt;&gt; np.linspace(0.0, 1.0, num=10.0)
array([0.        , 0.11111111, 0.22222222, 0.33333333, 0.44444444,
       0.55555556, 0.66666667, 0.77777778, 0.88888889, 1.        ])
&gt;&gt;&gt; 
(numpy1.17) moorepants@garuda:four_bar_linkage(master)$ 
(numpy1.17) moorepants@garuda:four_bar_linkage(master)$ deact
DeprecationWarning: 'source deactivate' is deprecated. Use 'conda deactivate'.
moorepants@garuda:four_bar_linkage(master)$ python
Python 3.6.10 | packaged by conda-forge | (default, Mar  5 2020, 10:05:08) 
[GCC 7.3.0] on linux
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&gt;&gt;&gt; import numpy as np
&gt;&gt;&gt; np.__version__
'1.18.1'
&gt;&gt;&gt; np.linspace(0.0, 1.0, num=10.0)
Traceback (most recent call last):
  File &quot;/home/moorepants/miniconda3/lib/python3.6/site-packages/numpy/core/function_base.py&quot;, line 117, in linspace
    num = operator.index(num)
TypeError: 'float' object cannot be interpreted as an integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  File &quot;&lt;__array_function__ internals&gt;&quot;, line 6, in linspace
  File &quot;/home/moorepants/miniconda3/lib/python3.6/site-packages/numpy/core/function_base.py&quot;, line 121, in linspace
    .format(type(num)))
TypeError: object of type &lt;class 'float'&gt; cannot be safely interpreted as an integer.
"><pre class="notranslate"><code class="notranslate">(numpy1.17) moorepants@garuda:four_bar_linkage(master)$ python
Python 3.8.2 | packaged by conda-forge | (default, Mar 23 2020, 18:16:37) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import numpy as np
&gt;&gt;&gt; np.__version__
'1.17.5'
&gt;&gt;&gt; np.linspace(0.0, 1.0, num=10.0)
array([0.        , 0.11111111, 0.22222222, 0.33333333, 0.44444444,
       0.55555556, 0.66666667, 0.77777778, 0.88888889, 1.        ])
&gt;&gt;&gt; 
(numpy1.17) moorepants@garuda:four_bar_linkage(master)$ 
(numpy1.17) moorepants@garuda:four_bar_linkage(master)$ deact
DeprecationWarning: 'source deactivate' is deprecated. Use 'conda deactivate'.
moorepants@garuda:four_bar_linkage(master)$ python
Python 3.6.10 | packaged by conda-forge | (default, Mar  5 2020, 10:05:08) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import numpy as np
&gt;&gt;&gt; np.__version__
'1.18.1'
&gt;&gt;&gt; np.linspace(0.0, 1.0, num=10.0)
Traceback (most recent call last):
  File "/home/moorepants/miniconda3/lib/python3.6/site-packages/numpy/core/function_base.py", line 117, in linspace
    num = operator.index(num)
TypeError: 'float' object cannot be interpreted as an integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "&lt;__array_function__ internals&gt;", line 6, in linspace
  File "/home/moorepants/miniconda3/lib/python3.6/site-packages/numpy/core/function_base.py", line 121, in linspace
    .format(type(num)))
TypeError: object of type &lt;class 'float'&gt; cannot be safely interpreted as an integer.

</code></pre></div>

<h3 dir="auto">Error message:</h3>


<h3 dir="auto">Numpy/Python version information:</h3>