package scipy

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
val get_py : string -> Py.Object.t

Get an attribute of this module as a Py.Object.t. This is useful to pass a Python function to another function.

module QhullError : sig ... end
val asbytes : Py.Object.t -> Py.Object.t

None

val tsearch : tri:Py.Object.t -> xi:Py.Object.t -> unit -> Py.Object.t

tsearch(tri, xi)

Find simplices containing the given points. This function does the same thing as `Delaunay.find_simplex`.

.. versionadded:: 0.9

See Also -------- Delaunay.find_simplex

Examples --------

>>> import numpy as np >>> import matplotlib.pyplot as plt >>> from scipy.spatial import Delaunay, delaunay_plot_2d, tsearch

The Delaunay triangulation of a set of random points:

>>> pts = np.random.rand(20, 2) >>> tri = Delaunay(pts) >>> _ = delaunay_plot_2d(tri)

Find the simplices containing a given set of points:

>>> loc = np.random.uniform(0.2, 0.8, (5, 2)) >>> s = tsearch(tri, loc) >>> plt.triplot(pts:, 0, pts:, 1, tri.simplicess, 'b-', mask=s==-1) >>> plt.scatter(loc:, 0, loc:, 1, c='r', marker='x') >>> plt.show()

OCaml

Innovation. Community. Security.