Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numpy Type Error when using freq_gen function #1

Open
MikeJewski opened this issue Feb 27, 2020 · 5 comments
Open

Numpy Type Error when using freq_gen function #1

MikeJewski opened this issue Feb 27, 2020 · 5 comments

Comments

@MikeJewski
Copy link

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

@kbknudsen
Copy link
Owner

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

@jochenkieninger
Copy link

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!

@C4rst3n
Copy link

C4rst3n commented Apr 16, 2020

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)

@jochenkieninger
Copy link

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!

@sameer9406
Copy link

Thanks @C4rst3n your solution worked for me too.

CLRom pushed a commit to CLRom/PyEIS that referenced this issue Jun 29, 2020
CLRom pushed a commit to CLRom/PyEIS that referenced this issue Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants