diff --git a/examples/applications/plot_tomography_l1_reconstruction.py b/examples/applications/plot_tomography_l1_reconstruction.py index dc0a1265e27bd..24996e5568e2e 100644 --- a/examples/applications/plot_tomography_l1_reconstruction.py +++ b/examples/applications/plot_tomography_l1_reconstruction.py @@ -34,6 +34,7 @@ class :class:`sklearn.linear_model.Lasso`, that uses the coordinate descent the circular artifact separating the pixels in the corners, that have contributed to fewer projections than the central disk. """ +from __future__ import division print(__doc__) @@ -50,7 +51,7 @@ class :class:`sklearn.linear_model.Lasso`, that uses the coordinate descent def _weights(x, dx=1, orig=0): x = np.ravel(x) - floor_x = np.floor((x - orig) / dx) + floor_x = np.floor((x - orig) / dx).astype(np.int64) alpha = (x - orig - floor_x * dx) / dx return np.hstack((floor_x, floor_x + 1)), np.hstack((1 - alpha, alpha)) @@ -112,7 +113,7 @@ def generate_synthetic_data(): # Generate synthetic images, and projections l = 128 -proj_operator = build_projection_operator(l, l / 7.) +proj_operator = build_projection_operator(l, l // 7) data = generate_synthetic_data() proj = proj_operator * data.ravel()[:, np.newaxis] proj += 0.15 * np.random.randn(*proj.shape)