Skip to content

Commit 508e2f7

Browse files
lesteveamueller
authored andcommitted
FIX examples with numpy 1.13
1 parent 8d9b58b commit 508e2f7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

examples/applications/plot_tomography_l1_reconstruction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def generate_synthetic_data():
107107
mask[(points[0]).astype(np.int), (points[1]).astype(np.int)] = 1
108108
mask = ndimage.gaussian_filter(mask, sigma=l / n_pts)
109109
res = np.logical_and(mask > mask.mean(), mask_outer)
110-
return res - ndimage.binary_erosion(res)
110+
return np.logical_xor(res, ndimage.binary_erosion(res))
111111

112112

113113
# Generate synthetic images, and projections

examples/cluster/plot_dbscan.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252

5353
# Black removed and is used for noise instead.
5454
unique_labels = set(labels)
55-
colors = plt.cm.Spectral(np.linspace(0, 1, len(unique_labels)))
55+
colors = [plt.cm.Spectral(each)
56+
for each in np.linspace(0, 1, len(unique_labels))]
5657
for k, col in zip(unique_labels, colors):
5758
if k == -1:
5859
# Black used for noise.

0 commit comments

Comments
 (0)