From 862298da092fd09abc69f9703b8c0765a2ca7625 Mon Sep 17 00:00:00 2001 From: Andrew Seier Date: Mon, 9 May 2016 22:00:54 -0700 Subject: [PATCH] In python 3 `map` is a generator, `list()` it! MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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! --- plotly/tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plotly/tools.py b/plotly/tools.py index f09e056181c..08648a79cd0 100644 --- a/plotly/tools.py +++ b/plotly/tools.py @@ -1562,7 +1562,7 @@ def _trisurf(x, y, z, simplices, colormap=None, points3D = np.vstack((x, y, z)).T # vertices of the surface triangles - tri_vertices = map(lambda index: points3D[index], simplices) + tri_vertices = list(map(lambda index: points3D[index], simplices)) # mean values of z-coordinates of triangle vertices zmean = [np.mean(tri[:, 2]) for tri in tri_vertices] min_zmean = np.min(zmean)