-
Notifications
You must be signed in to change notification settings - Fork 19
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
TypeError: 'float' object cannot be interpreted as an integer #6
Comments
Any update on this ? I tried changing to SHTns but that has this issue - https://bitbucket.org/nschaeff/shtns/issues/38/valueerror-nlat-must-be-even |
The issue would be with this line here: numpy.reshape(chispec, ((ntrunc+1)*(ntrunc+2)/2,1)) In python 3, the normal numpy.reshape(chispec, ((ntrunc+1)*(ntrunc+2)//2,1)) That error in particular looks like issues I found when running the example code recently. |
@DWesl Great work !!! |
@DWesl Would you be interested in collaborating with me on a rewrite of this package ? |
I have this sample code that I am running using pyspharm and I am getting this error -
` file1 = 'uwnd_200_2020_3_10_00Z.nc'
file2 = 'vwnd_200_2020_3_10_00Z.nc'
`
amd I am getting this error -
Where am I going wrong ?
File "testspharm.py", line 29, in main dudx,dudy = s.getgrad(uspectral) File "/usr/local/lib/python3.8/dist-packages/spharm/spharm.py", line 878, in getgrad chispec = numpy.reshape(chispec, ((ntrunc+1)*(ntrunc+2)/2,1)) File "<__array_function__ internals>", line 5, in reshape File "/usr/local/lib/python3.8/dist-packages/numpy-1.19.1-py3.8-linux-x86_64.egg/numpy/core/fromnumeric.py", line 299, in reshape return _wrapfunc(a, 'reshape', newshape, order=order) File "/usr/local/lib/python3.8/dist-packages/numpy-1.19.1-py3.8-linux-x86_64.egg/numpy/core/fromnumeric.py", line 67, in _wrapfunc return _wrapit(obj, method, *args, **kwds) File "/usr/local/lib/python3.8/dist-packages/numpy-1.19.1-py3.8-linux-x86_64.egg/numpy/core/fromnumeric.py", line 44, in _wrapit result = getattr(asarray(obj), method)(*args, **kwds) TypeError: 'float' object cannot be interpreted as an integer
The text was updated successfully, but these errors were encountered: