Can't access data from `.get_array()` or `.a` of the PropertyMap generated by triangulation method
>>>import numpy as np
>>>from graph_tool.generation import triangulation
>>>
>>> data = np.random.rand(10, 2)*200
>>> data
array([[ 4.55043023, 127.46915983],
[ 14.28788358, 110.78747393],
[ 30.09167454, 158.52828923],
[ 125.17424516, 188.96780485],
[ 150.93032652, 144.1025631 ],
[ 42.68486983, 31.73370705],
[ 64.28908632, 152.77584533],
[ 158.5010769 , 154.92110257],
[ 97.08820607, 103.06020203],
[ 74.27106945, 17.75048636]])
>>> g, pos = triangulation(data, 'delaunay')
>>> for v in g.vertices():
... print(pos[v])
...
...
array([ 4.55043023, 127.46915983, 0. ])
array([ 14.28788358, 110.78747393, 0. ])
array([ 30.09167454, 158.52828923, 0. ])
array([ 125.17424516, 188.96780485, 0. ])
array([ 150.93032652, 144.1025631 , 0. ])
array([ 42.68486983, 31.73370705, 0. ])
array([ 64.28908632, 152.77584533, 0. ])
array([ 158.5010769 , 154.92110257, 0. ])
array([ 97.08820607, 103.06020203, 0. ])
array([ 74.27106945, 17.75048636, 0. ])
>>> pos.a
>>> pos.a[:]
Traceback (most recent call last):
File "<input>", line 1, in <module>
TypeError: 'NoneType' object has no attribute '__getitem__'
>>> pos.get_array()
>>> pos.get_array()[:]
Traceback (most recent call last):
File "<input>", line 1, in <module>
TypeError: 'NoneType' object has no attribute '__getitem__'
I want to get the data from pos
after triangulation, but pos.a
is None
.
Is there any other way to get numpy.array
data besides iterating over vertices ?
Thank YOU very much !