Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a47b88d

Browse files
committed
Rewrote reduce() line more explicitly and clearly for compatibility with Python 2, 3.3 and 3.4
1 parent 6756fc3 commit a47b88d

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

plotly/tools.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,17 +1583,20 @@ def _trisurf(x, y, z, simplices, colormap=None,
15831583
lists_coord = ([[[T[k % 3][c] for k in range(4)]+[None]
15841584
for T in tri_vertices] for c in range(3)])
15851585

1586-
Xe = lists_coord[0][0] + lists_coord[0][1]
1587-
for index in range(2, len(lists_coord[0])):
1588-
Xe = Xe + lists_coord[0][index]
1589-
1590-
Ye = lists_coord[1][0] + lists_coord[1][1]
1591-
for index in range(2, len(lists_coord[1])):
1592-
Ye = Ye + lists_coord[1][index]
1593-
1594-
Ze = lists_coord[2][0] + lists_coord[2][1]
1595-
for index in range(2, len(lists_coord[2])):
1596-
Ze = Ze + lists_coord[2][index]
1586+
Xe = []
1587+
for array in lists_coord[0]:
1588+
for item in array:
1589+
Xe.append(item)
1590+
1591+
Ye = []
1592+
for array in lists_coord[1]:
1593+
for item in array:
1594+
Ye.append(item)
1595+
1596+
Ze = []
1597+
for array in lists_coord[2]:
1598+
for item in array:
1599+
Ze.append(item)
15971600

15981601
# define the lines to be plotted
15991602
lines = graph_objs.Scatter3d(

0 commit comments

Comments
 (0)