You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
frominterpolationimportmlinterpx1=np.linspace(0,1,100)**2# non-uniform points for first dimensoinx2= (0,1,100) # uniform points for second dimensiongrid= (x1,x2)
y=np.array([[np.sqrt(u1**2+u2**2) foru2inx2] foru1inx1])
points=np.random.random((1000,2))
# vectorized call:mlinterp(grid, y, points)
# non-vectorized call (note third argument must be a tuple of floats of right size)mlinterp(grid, y, (0.4, 0.2))
But that gives:
TypeError Traceback (most recent call last)
<ipython-input-41-1cbb81f46b37> in <module>
10
11 # vectorized call:
---> 12 mlinterp(grid, y, points)
13
14 # non-vectorized call (note third argument must be a tuple of floats of right size)
TypeError: fmap() takes 0 positional arguments but 3 were given
Is the issue only at my end?
Installed interpolation with conda, as suggested in the README.
Python 3.7.3
MacOS 10.13.6
The text was updated successfully, but these errors were encountered:
Hey @dangom. It is the example code which is wrong (I'm fixing it). Everything is based on type dispatch so the specification of the grid must respect the type. In particular, floats and ints are two different types.
So it should be x2 = (0.0,1.0,100) instead of x2 = (0,1,100).
I tried to evaluate the example code:
But that gives:
Is the issue only at my end?
Installed interpolation with conda, as suggested in the README.
Python 3.7.3
MacOS 10.13.6
The text was updated successfully, but these errors were encountered: