Ce n'est pas nécessairement une réponse mais juste un complément d'information, lorsque j'exécute ce code exact, j'obtiens ceci en sortie, en tant que couleur d'erreur :
Traceback (most recent call last):
File "/Users/tadhgmcdonald-jensen/Documents/test.py", line 8, in <module>
interp = LinearNDInterpolator(pts, z, fill_value= np.nan)
File "interpnd.pyx", line 248, in scipy.interpolate.interpnd.LinearNDInterpolator.__init__
File "qhull.pyx", line 1833, in scipy.spatial.qhull.Delaunay.__init__
File "qhull.pyx", line 355, in scipy.spatial.qhull._Qhull.__init__
scipy.spatial.qhull.QhullError: QH6154 Qhull precision error: Initial simplex is flat (facet 1 is coplanar with the interior point)
While executing: | qhull d Q12 Qbb Qc Qt Qz
Options selected for Qhull 2015.2.r 2016/01/18:
run-id 923456758 delaunay Q12-no-wide-dup Qbbound-last Qcoplanar-keep
Qtriangulate Qz-infinity-point _pre-merge _zero-centrum Qinterior-keep
Pgood _max-width 2 Error-roundoff 5.5e-15 _one-merge 3.9e-14
Visible-distance 1.1e-14 U-coplanar-distance 1.1e-14 Width-outside 2.2e-14
_wide-facet 6.7e-14
precision problems (corrected unless 'Q0' or an error)
2 flipped facets
The input to qhull appears to be less than 3 dimensional, or a
computation has overflowed.
Qhull could not construct a clearly convex simplex from points:
- p1(v3): 2 3 0.71
- p3(v2): 2 3 2
- p2(v1): 3 4 1.8
- p0(v0): 1 2 5.6e-17
The center point is coplanar with a facet, or a vertex is coplanar
with a neighboring facet. The maximum round off error for
computing distances is 5.5e-15. The center point, facets and distances
to the center point are as follows:
center point 2 3 1.122
facet p3 p2 p0 distance= 0
facet p1 p2 p0 distance= 0
facet p1 p3 p0 distance= 0
facet p1 p3 p2 distance= 0
These points either have a maximum or minimum x-coordinate, or
they maximize the determinant for k coordinates. Trial points
are first selected from points that maximize a coordinate.
The min and max coordinates for each dimension are:
0: 1 3 difference= 2
1: 2 4 difference= 2
2: 5.551e-17 2 difference= 2
If the input should be full dimensional, you have several options that
may determine an initial simplex:
- use 'QJ' to joggle the input and make it full dimensional
- use 'QbB' to scale the points to the unit cube
- use 'QR0' to randomly rotate the input for different maximum points
- use 'Qs' to search all points for the initial simplex
- use 'En' to specify a maximum roundoff error less than 5.5e-15.
- trace execution with 'T3' to see the determinant for each point.
If the input is lower dimensional:
- use 'QJ' to joggle the input and make it full dimensional
- use 'Qbk:0Bk:0' to delete coordinate k from the input. You should
pick the coordinate with the least range. The hull will have the
correct topology.
- determine the flat containing the points, rotate the points
into a coordinate plane, and delete the other coordinates.
- add one or more points to make the input full dimensional.
Je ne connais pas assez Scipy pour savoir exactement ce qui se passe, mais est-il possible que votre entrée soit invalide et que vous n'obteniez pas de sortie significative sur votre machine ? Cela pourrait être pertinent de signaler un bogue à Scipy.
scipy.version.version == '1.3.1' and numpy.version.version == '1.17.3'