Closed dotanrs closed 5 years ago
Hey dotanrs Thanks for sharing. I faced the same issue when using python 3. For me (window 10,python 3.5) double slashes (//) do the trick.
Excellent! Thank you dotanrs
First, I tried modifying the thinkdsp.py python package file, while I was in the Jupyter session with thinkdsp imported, this did not immediately resolve the bug, tried reimporting thinkdsp, still did not work. But later tried loading my Jupyter session again and it gave me results.
I have taken next step and created a pull request with proposed solution. Once again kudos - dotanrs.
And it is merged. Thanks again!
On Mon, Aug 13, 2018 at 8:06 PM, aryabhatta000 notifications@github.com wrote:
Excellent! Thank you dotanrs
First, I tried modifying the thinkdsp.py python package file, while I was in the Jupyter session with thinkdsp imported, this did not immediately resolve the bug, tried reimporting thinkdsp, still did not work. But later tried loading my Jupyter session again and it gave me results.
I have taken next step and created a pull request with proposed solution. Once again kudos - dotanrs.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/AllenDowney/ThinkDSP/issues/36#issuecomment-412707562, or mute the thread https://github.com/notifications/unsubscribe-auth/ABy37eiNA7A-RSkd7COGSwnbq7FOJF9Dks5uQhSJgaJpZM4OzdMA .
Steps to reproduce the issue
Run the function with a recent numpy version
Expected result
a spectrogram should appear
Actual result
error: TypeError: slice indices must be integers or None or have an index method
Additional comments
This can be easily fixed by changing line 937 from step = seg_length // 2 to step = int(seg_length // 2)
this is because in the new numpy version a slice index can't be a float, and step, which is a float as the result of a // operation, goes on to be a slice index
(I'm new to open source and didn't know how to create a pull request, so I wrote it here)