niknow / pydata-london-2016-voronoi Goto Github PK
View Code? Open in Web Editor NEWSpherical Voronoi Diagrams in Python
License: MIT License
Spherical Voronoi Diagrams in Python
License: MIT License
Hello,
When i run this simple portion of code
import numpy as np
from scipy.spatial import SphericalVoronoi, distance
from scipy.spatial import _spherical_voronoi as spherical_voronoi
test = np.array([[-0.1382177 , -0.66701253, 0.36649207],
[-0.33718559, -0.0515926 , 0.7109696 ],
[-0.13633904, -0.65712506, 0.3830903 ],
[ 0.04510981, 0.72285262, 0.35677763],
[-0.14008791, -0.65997704, 0.37445958],
[-0.7253343 , -0.26837762, 0.00655405],
[-0.58085674, -0.40511863, -0.36093304],
[ 0.2780397 , 0.72729778, 0.24511902],
[-0.33315233, -0.16453994, -0.6972229 ],
[-0.46532148, 0.35901168, -0.45935981],
[-0.72827086, -0.25884677, -0.00137087],
[-0.72758263, -0.25989862, 0.00278446],
[-0.70204518, -0.31395337, -0.0467136 ],
[-0.71771464, -0.28226784, -0.01436788],
[-0.72884793, -0.25239507, 0.01278218],
[-0.72528059, -0.26018933, -0.00931674],
[ 0.23175783, -0.68754004, 0.24004559],
[ 0.69090723, -0.2371959 , -0.19492292],
[ 0.40653046, -0.63173528, -0.25505239],
[ 0.53203067, -0.52945865, -0.14520801],
[ 0.52527016, -0.53501648, -0.2155609 ],
[ 0.56226738, -0.31942141, -0.39975375]])
sv = SphericalVoronoi(test)
sv.sort_vertices_of_regions()
I get the following error :
Python 2.7.12 |Anaconda custom (64-bit)| (default, Jul 2 2016, 17:42:40)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import numpy as np
>>> from scipy.spatial import SphericalVoronoi, distance
>>> from scipy.spatial import _spherical_voronoi as spherical_voronoi
>>>
>>> test = np.array([[-0.1382177 , -0.66701253, 0.36649207],
... [-0.33718559, -0.0515926 , 0.7109696 ],
... [-0.13633904, -0.65712506, 0.3830903 ],
... [ 0.04510981, 0.72285262, 0.35677763],
... [-0.14008791, -0.65997704, 0.37445958],
... [-0.7253343 , -0.26837762, 0.00655405],
... [-0.58085674, -0.40511863, -0.36093304],
... [ 0.2780397 , 0.72729778, 0.24511902],
... [-0.33315233, -0.16453994, -0.6972229 ],
... [-0.46532148, 0.35901168, -0.45935981],
... [-0.72827086, -0.25884677, -0.00137087],
... [-0.72758263, -0.25989862, 0.00278446],
... [-0.70204518, -0.31395337, -0.0467136 ],
... [-0.71771464, -0.28226784, -0.01436788],
... [-0.72884793, -0.25239507, 0.01278218],
... [-0.72528059, -0.26018933, -0.00931674],
... [ 0.23175783, -0.68754004, 0.24004559],
... [ 0.69090723, -0.2371959 , -0.19492292],
... [ 0.40653046, -0.63173528, -0.25505239],
... [ 0.53203067, -0.52945865, -0.14520801],
... [ 0.52527016, -0.53501648, -0.2155609 ],
... [ 0.56226738, -0.31942141, -0.39975375]])
>>>
>>> sv = SphericalVoronoi(test)
>>> sv.sort_vertices_of_regions()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/env/export/cns_n02_agc/agc/home/ggautrea/anaconda2/lib/python2.7/site-packages/scipy/spatial/_spherical_voronoi.py", line 319, in sort_vertices_of_regions
][0]
IndexError: list index out of range
Can you help me ?
Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.