Skip to content

Commit 862298d

Browse files
committed
In python 3 map is a generator, list() it!
In python 2, you typically get `list` objects. For efficiency (AFAIK) in python 3 you’ll get a generator. Note that you can’t iterate through a generator more than once though!
1 parent f77b8e6 commit 862298d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plotly/tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1562,7 +1562,7 @@ def _trisurf(x, y, z, simplices, colormap=None,
15621562
points3D = np.vstack((x, y, z)).T
15631563

15641564
# vertices of the surface triangles
1565-
tri_vertices = map(lambda index: points3D[index], simplices)
1565+
tri_vertices = list(map(lambda index: points3D[index], simplices))
15661566
# mean values of z-coordinates of triangle vertices
15671567
zmean = [np.mean(tri[:, 2]) for tri in tri_vertices]
15681568
min_zmean = np.min(zmean)

0 commit comments

Comments
 (0)