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

prep_data on np.float arrays raises exception #89

Closed
t0medwards opened this issue Dec 19, 2017 · 1 comment
Closed

prep_data on np.float arrays raises exception #89

t0medwards opened this issue Dec 19, 2017 · 1 comment

Comments

@t0medwards
Copy link
Contributor

I am having problems when converting numpy float arrays using the prep_data command with recent versions of windpharm. The following code:

import numpy as np
from windspharm.tools import prep_data

u = np.zeros([180,360], np.float)

uwnd, uwnd_info = prep_data(u, 'yx')

Causes the following error:

Traceback (most recent call last):
  File "test.py", line 9, in <module>
    uwnd, uwnd_info = prep_data(u, 'yx')
  File "/home/tom/tmp/windpharm-bug/two/windspharm/lib/windspharm/tools.py", line 98, in prep_data
    pdata, intshape = __reshape(pdata)
  File "/home/tom/tmp/windpharm-bug/two/windspharm/lib/windspharm/tools.py", line 46, in __reshape
    out = d.reshape(d.shape[:2] + (np.prod(d.shape[2:]),))
TypeError: 'numpy.float64' object cannot be interpreted as an index

With numpy 1.12 and 1.13 (anaconda nomkl installs).

However, I may be using prep_data incorrectly?

@ajdawson
Copy link
Owner

Closed by #90.

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

2 participants