Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3b52513

Browse filesBrowse files
committed
remove pre python26 workaround
1 parent 0635dfe commit 3b52513
Copy full SHA for 3b52513

File tree

Expand file treeCollapse file tree

1 file changed

+1
-14
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-14
lines changed

‎doc/users/plotting/examples/demo_gridspec06.py

Copy file name to clipboardExpand all lines: doc/users/plotting/examples/demo_gridspec06.py
+1-14Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,7 @@
11
import matplotlib.pyplot as plt
22
import matplotlib.gridspec as gridspec
33
import numpy as np
4-
5-
try:
6-
from itertools import product
7-
except ImportError:
8-
# product is new in v 2.6
9-
def product(*args, **kwds):
10-
pools = map(tuple, args) * kwds.get('repeat', 1)
11-
result = [[]]
12-
for pool in pools:
13-
result = [x+[y] for x in result for y in pool]
14-
for prod in result:
15-
yield tuple(prod)
16-
4+
from itertools import product
175

186
def squiggle_xy(a, b, c, d, i=np.arange(0.0, 2*np.pi, 0.05)):
197
return np.sin(i*a)*np.cos(i*b), np.sin(i*c)*np.cos(i*d)
@@ -50,4 +38,3 @@ def squiggle_xy(a, b, c, d, i=np.arange(0.0, 2*np.pi, 0.05)):
5038
ax.spines['right'].set_visible(True)
5139

5240
plt.show()
53-

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.