AllenDowney / ThinkDSP

Think DSP: Digital Signal Processing in Python, by Allen B. Downey.
https://allendowney.github.io/ThinkDSP/
3.93k stars 3.2k forks source link

AttributeError exception being thrown in thinkdsp.py call to numpy #92

Open sizzzzlerz opened 1 year ago

sizzzzlerz commented 1 year ago

I am running the notebooks using Python 3.11 and the latest numpy version 1.25.0.

Line 599 in thinkdsp.py is causing an AttributeError exception to be thrown in spectrogram.plot

array = np.zeros(size, dtype=np.float)

The exception is complaining that np.float has been deprecated from numpy and that just 'float' alone should be used. I found this in other places in the file but this was the first one that was invoked. To fix this, I edited thinkdsp.py to make the changes. Once that was done, the entire notebook ran to completion.

AllenDowney commented 1 year ago

Should be fixed now. Thanks for letting me know!

AllenDowney commented 1 year ago

And now I have a github workflow to run the tests periodically, so things like this should not sneak up on me again!