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 5e1adca

Browse filesBrowse files
committed
DOC: fix py2 compatibility issue
- Turns out that maxsplit can only be used as a keyword arg in py3.3+ - use - instead of — to play nice with python2
1 parent 1209e70 commit 5e1adca
Copy full SHA for 5e1adca

File tree

Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed

‎examples/showcase/mandelbrot.py

Copy file name to clipboardExpand all lines: examples/showcase/mandelbrot.py
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ def mandelbrot_set(xmin, xmax, ymin, ymax, xn, yn, maxiter, horizon=2.0):
4747
# This line will generate warnings for null values but it is faster to
4848
# process them afterwards using the nan_to_num
4949
with np.errstate(invalid='ignore'):
50-
M = np.nan_to_num(N + 1 - np.log(np.log(abs(Z)))/np.log(2) + log_horizon)
50+
M = np.nan_to_num(N + 1 -
51+
np.log(np.log(abs(Z)))/np.log(2) +
52+
log_horizon)
5153

5254
dpi = 72
5355
width = 10
@@ -65,7 +67,7 @@ def mandelbrot_set(xmin, xmax, ymin, ymax, xn, yn, maxiter, horizon=2.0):
6567

6668
# Some advertisement for matplotlib
6769
year = time.strftime("%Y")
68-
major, minor, micro = matplotlib.__version__.split('.', maxsplit=2)
70+
major, minor, micro = matplotlib.__version__.split('.', 2)
6971
text = ("The Mandelbrot fractal set\n"
7072
"Rendered with matplotlib %s.%s, %s — http://matplotlib.org"
7173
% (major, minor, year))

0 commit comments

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