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

Skip to content

Commit 3b52513

Browse files
committed
remove pre python26 workaround
1 parent 0635dfe commit 3b52513

1 file changed

Lines changed: 1 addition & 14 deletions

File tree

doc/users/plotting/examples/demo_gridspec06.py

Lines 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)