New answers tagged scipy
0
Using the .tree attribute of cKDTree gives you direct access to the kdtree. You can recursively navigate it like this:
from scipy.spatial import cKDTree
tree = cKDTree(points) # let points be an array of shape (n,2)
groups = []
depth = 5 # depth of the tree, ie: depth=5 results in 64 bins
def recurse(node, i=0):
g = node.greater
l = node.lesser
...
0
NLopt
has about a dozen local derivative-free optimizers, including SLSQP in C.
Only COBYLA currently supports arbitrary nonlinear inequality and equality constraints;
the rest of them support bound-constrained or unconstrained problems only.
(However, any of them can be applied to nonlinearly constrained problems by combining them with the
augmented ...
0
You could compute the Voronoi diagram. Each cell in this diagram contains exactly one point and taken together the cells cover the domain. If you need, say, $n$ points in each bin, it is then a matter of picking a cell, merging it with its $n-1$ neighbors, and doing the same for the remaining cells.
Top 50 recent answers are included
Related Tags
scipy × 186python × 110
ode × 31
numpy × 28
optimization × 23
integration × 16
sparse-matrix × 15
numerics × 13
linear-algebra × 12
quadrature × 11
matrix × 8
interpolation × 8
differential-equations × 8
nonlinear-equations × 7
computational-physics × 6
constrained-optimization × 6
lapack × 6
matrix-factorization × 6
pde × 5
convex-optimization × 5
linear-solver × 4
eigenvalues × 4
convergence × 4
runge-kutta × 4
nonlinear-programming × 4