PyEIS icon indicating copy to clipboard operation
PyEIS copied to clipboard

Numpy Type Error when using freq_gen function

Open MikeJewski opened this issue 5 years ago • 5 comments

Running the second line in the Jupyter notebook tutorial "PyEIS_simulation_tutorial" results in a Type Error:

TypeError: 'numpy.float64' object cannot be interpreted as an integer

Can be traced back to line 62 in PyEIS.py: f_range = np.logspace(np.log10(f_start), np.log10(f_stop), num=np.around(pts_decade*f_decades), endpoint=True)

Where np.around() passes a float to number of points in np.logspace

MikeJewski avatar Feb 27 '20 12:02 MikeJewski

Could you please attach versions of numpy and python, that you're currently using

kbknudsen avatar Mar 06 '20 14:03 kbknudsen

After updating my Python environment, I got a similar problem with a script, which was previously running fine. Now versions are numpy 1.18.1 and python 3.7.6.

Thank you Kristian for providing PyEIS!

jochenkieninger avatar Apr 02 '20 14:04 jochenkieninger

I have the same Problem Python 3.7.5 numpy 1.18.2 Solution is to change PyEis.py line 60 to this f_range = np.logspace(np.log10(f_start), np.log10(f_stop), num=np.around(pts_decade*f_decades).astype(int), endpoint=True)

C4rst3n avatar Apr 16 '20 08:04 C4rst3n

Solution is to change PyEis.py line 60 to this f_range = np.logspace(np.log10(f_start), np.log10(f_stop), num=np.around(pts_decade*f_decades).astype(int), endpoint=True)

Thank you @C4rst3n - the solution worked for me!

jochenkieninger avatar Apr 20 '20 15:04 jochenkieninger

Thanks @C4rst3n your solution worked for me too.

sameer9406 avatar Apr 22 '20 12:04 sameer9406