Skip to content

⚠️ CI failed on Linux_Docker.debian_atlas_32bit (last failure: Sep 03, 2024) ⚠️ #25686

Closed

Description

@scikit-learn-bot

CI is still failing on Linux_Docker.debian_atlas_32bit (Sep 03, 2024)

  • test_spectral_clustering_with_arpack_amg_solvers
  • test_img_to_graph
  • test_imputation_mean_median[csc_matrix]
  • test_imputation_mean_median[csc_array]
  • test_robust_scale_axis1

Activity

  1. added
    Needs Triage
    on Feb 24, 2023
  2. scikit-learn-bot commented on Feb 25, 2023

    @scikit-learn-bot
    ContributorAuthor

    CI is no longer failing! ✅

    Successful run on Sep 04, 2024

  3. thomasjpfan commented on Feb 25, 2023

    @thomasjpfan
    Member

    This was an real failure with 32bit Linux, when SKLEARN_TESTS_GLOBAL_RANDOM_SEED="50".

  4. added and removed
    Needs Triage
    on Feb 25, 2023
  5. thomasjpfan commented on Mar 8, 2023

    @thomasjpfan
    Member

    Just in case the logs are removed, here is the trackback:

    Traceback
        def test_inverse_transform(
            whiten, n_components, expected_mixing_shape, global_random_seed, global_dtype
        ):
            # Test FastICA.inverse_transform
            n_samples = 100
            rng = np.random.RandomState(global_random_seed)
            X = rng.random_sample((n_samples, 10)).astype(global_dtype)
        
            ica = FastICA(n_components=n_components, random_state=rng, whiten=whiten)
            with warnings.catch_warnings():
                # For some dataset (depending on the value of global_dtype) the model
                # can fail to converge but this should not impact the definition of
                # a valid inverse transform.
                warnings.simplefilter("ignore", ConvergenceWarning)
                Xt = ica.fit_transform(X)
            assert ica.mixing_.shape == expected_mixing_shape
            X2 = ica.inverse_transform(Xt)
            assert X.shape == X2.shape
        
            # reversibility test in non-reduction case
            if n_components == X.shape[1]:
                # XXX: we have to set atol for this test to pass for all seeds when
                # fitting with float32 data. Is this revealing a bug?
                if global_dtype:
                    # XXX: dividing by a smaller number makes
                    # tests fail for some seeds.
                    atol = np.abs(X2).mean() / 1e5
                else:
                    atol = 0.0  # the default rtol is enough for float64 data
    >           assert_allclose(X, X2, atol=atol)
    
    X          = array([[0.49460164, 0.2280831 , 0.2554739 , 0.3963299 , 0.3773151 ,
            0.9965742 , 0.4081972 , 0.771894  , 0.7605...01 , 0.8702239 , 0.85998875,
            0.9062211 , 0.52288705, 0.5902804 , 0.97106504, 0.39498487]],
          dtype=float32)
    X2         = array([[ 0.45655584,  0.53900224,  0.25547385,  0.22837974,  0.5666931 ,
             0.8485345 ,  0.50125885,  0.50586027....6070828 ,  0.69734764,
             0.67427313,  0.61682725,  0.6224894 ,  0.6810832 ,  0.6395092 ]],
          dtype=float32)
    Xt         = array([[ 8.86449367e-02, -1.35140147e+12,  4.84007215e+11,
            -4.84007215e+11,  3.34746321e+11, -5.69215943e+11,
    ..., -7.34393467e+11,
            -6.70885806e+11,  7.15465097e+11, -1.02009510e+12,
            -1.02305740e+12]], dtype=float32)
    atol       = 4.925061464309693e-06
    expected_mixing_shape = (10, 10)
    global_dtype = <class 'numpy.float32'>
    global_random_seed = 50
    ica        = FastICA(n_components=10, random_state=RandomState(MT19937) at 0xE4629DA8,
            whiten=False)
    n_components = 10
    n_samples  = 100
    rng        = RandomState(MT19937) at 0xE4629DA8
    whiten     = False
    
    /io/sklearn/decomposition/tests/test_fastica.py:362:
    
    [...]
            --------
            numpy.testing.assert_allclose
        
            Examples
            --------
            >>> import numpy as np
            >>> from sklearn.utils._testing import assert_allclose
            >>> x = [1e-5, 1e-3, 1e-1]
            >>> y = np.arccos(np.cos(x))
            >>> assert_allclose(x, y, rtol=1e-5, atol=0)
            >>> a = np.full(shape=10, fill_value=1e-5, dtype=np.float32)
            >>> assert_allclose(a, 1e-5)
            """
            dtypes = []
        
            actual, desired = np.asanyarray(actual), np.asanyarray(desired)
            dtypes = [actual.dtype, desired.dtype]
        
            if rtol is None:
                rtols = [1e-4 if dtype == np.float32 else 1e-7 for dtype in dtypes]
                rtol = max(rtols)
        
    >       np_assert_allclose(
                actual,
                desired,
                rtol=rtol,
                atol=atol,
                equal_nan=equal_nan,
                err_msg=err_msg,
                verbose=verbose,
            )
    E       AssertionError: 
    E       Not equal to tolerance rtol=0.0001, atol=4.92506e-06
    E       
    E       Mismatched elements: 899 / 1000 (89.9%)
    E       Max absolute difference: 0.6766666
    E       Max relative difference: 2.5423577
    E        x: array([[0.494602, 0.228083, 0.255474, 0.39633 , 0.377315, 0.996574,
    E               0.408197, 0.771894, 0.760537, 0.310009],
    E              [0.346541, 0.351765, 0.145467, 0.972665, 0.909178, 0.559957,...
    E        y: array([[ 0.456556,  0.539002,  0.255474,  0.22838 ,  0.566693,  0.848535,
    E                0.501259,  0.50586 ,  0.553476,  0.519691],
    E              [ 0.533576,  0.629931,  0.145467,  0.789647,  0.662293,  0.398639,...
    
    actual     = array([[0.49460164, 0.2280831 , 0.2554739 , 0.3963299 , 0.3773151 ,
            0.9965742 , 0.4081972 , 0.771894  , 0.7605...01 , 0.8702239 , 0.85998875,
            0.9062211 , 0.52288705, 0.5902804 , 0.97106504, 0.39498487]],
          dtype=float32)
    atol       = 4.925061464309693e-06
    desired    = array([[ 0.45655584,  0.53900224,  0.25547385,  0.22837974,  0.5666931 ,
             0.8485345 ,  0.50125885,  0.50586027....6070828 ,  0.69734764,
             0.67427313,  0.61682725,  0.6224894 ,  0.6810832 ,  0.6395092 ]],
          dtype=float32)
    dtypes     = [dtype('float32'), dtype('float32')]
    equal_nan  = True
    err_msg    = ''
    rtol       = 0.0001
    rtols      = [0.0001, 0.0001]
    verbose    = True
  6. ogrisel commented on Mar 9, 2023

    @ogrisel
    Member

    It seems that we still have numerical stability problems in either FastICA.fit_transform or in FastICA.inverse_transform.

  7. thomasjpfan commented on Dec 20, 2023

    @thomasjpfan
    Member

    Looks like another error with global random state:

    loss = 'absolute_error', subsample = 0.5, global_random_seed = 9
    
        @pytest.mark.parametrize("loss", ("squared_error", "absolute_error", "huber"))
        @pytest.mark.parametrize("subsample", (1.0, 0.5))
        def test_regression_dataset(loss, subsample, global_random_seed):
            # Check consistency on regression dataset with least squares
            # and least absolute deviation.
            ones = np.ones(len(y_reg))
            last_y_pred = None
            for sample_weight in [None, ones, 2 * ones]:
                # learning_rate, max_depth and n_estimators were adjusted to get a mode
                # that is accurate enough to reach a low MSE on the training set while
                # keeping the resource used to execute this test low enough.
                reg = GradientBoostingRegressor(
                    n_estimators=30,
                    loss=loss,
                    max_depth=4,
                    subsample=subsample,
                    min_samples_split=2,
                    random_state=global_random_seed,
                    learning_rate=0.5,
                )
        
                reg.fit(X_reg, y_reg, sample_weight=sample_weight)
                leaves = reg.apply(X_reg)
                assert leaves.shape == (100, 30)
        
                y_pred = reg.predict(X_reg)
                mse = mean_squared_error(y_reg, y_pred)
    >           assert mse < 0.05
    E           assert 0.061502134763447056 < 0.05
  8. changed the title [-]⚠️ CI failed on Linux_Docker.debian_atlas_32bit ⚠️[/-] [+]⚠️ CI failed on Linux_Docker.debian_atlas_32bit (last failure: May 02, 2024) ⚠️[/+] on May 2, 2024
  9. changed the title [-]⚠️ CI failed on Linux_Docker.debian_atlas_32bit (last failure: May 02, 2024) ⚠️[/-] [+]⚠️ CI failed on Linux_Docker.debian_atlas_32bit (last failure: Jun 19, 2024) ⚠️[/+] on Jun 19, 2024
  10. lesteve commented on Jun 19, 2024

    @lesteve
    Member

    Yet another one test_regression_dataset global_random_seed=9

    �[31m�[1m________________ test_regression_dataset[9-0.5-absolute_error] _________________�[0m
    
    loss = 'absolute_error', subsample = 0.5, global_random_seed = 9
    
        �[37m@pytest�[39;49;00m.mark.parametrize(�[33m"�[39;49;00m�[33mloss�[39;49;00m�[33m"�[39;49;00m, (�[33m"�[39;49;00m�[33msquared_error�[39;49;00m�[33m"�[39;49;00m, �[33m"�[39;49;00m�[33mabsolute_error�[39;49;00m�[33m"�[39;49;00m, �[33m"�[39;49;00m�[33mhuber�[39;49;00m�[33m"�[39;49;00m))
        �[37m@pytest�[39;49;00m.mark.parametrize(�[33m"�[39;49;00m�[33msubsample�[39;49;00m�[33m"�[39;49;00m, (�[94m1.0�[39;49;00m, �[94m0.5�[39;49;00m))
        �[94mdef�[39;49;00m �[92mtest_regression_dataset�[39;49;00m(loss, subsample, global_random_seed):
            �[90m# Check consistency on regression dataset with least squares�[39;49;00m
            �[90m# and least absolute deviation.�[39;49;00m
            ones = np.ones(�[96mlen�[39;49;00m(y_reg))
            last_y_pred = �[94mNone�[39;49;00m
            �[94mfor�[39;49;00m sample_weight �[95min�[39;49;00m [�[94mNone�[39;49;00m, ones, �[94m2�[39;49;00m * ones]:
                �[90m# learning_rate, max_depth and n_estimators were adjusted to get a mode�[39;49;00m
                �[90m# that is accurate enough to reach a low MSE on the training set while�[39;49;00m
                �[90m# keeping the resource used to execute this test low enough.�[39;49;00m
                reg = GradientBoostingRegressor(
                    n_estimators=�[94m30�[39;49;00m,
                    loss=loss,
                    max_depth=�[94m4�[39;49;00m,
                    subsample=subsample,
                    min_samples_split=�[94m2�[39;49;00m,
                    random_state=global_random_seed,
                    learning_rate=�[94m0.5�[39;49;00m,
                )
        
                reg.fit(X_reg, y_reg, sample_weight=sample_weight)
                leaves = reg.apply(X_reg)
                �[94massert�[39;49;00m leaves.shape == (�[94m100�[39;49;00m, �[94m30�[39;49;00m)
        
                y_pred = reg.predict(X_reg)
                mse = mean_squared_error(y_reg, y_pred)
    >           �[94massert�[39;49;00m mse < �[94m0.05�[39;49;00m
    �[1m�[31mE           assert 0.061502134763447056 < 0.05�[0m
    
    global_random_seed = 9
    last_y_pred = array([ 1.96914425e-01,  1.14397505e+00,  1.03623363e+00, -9.55692072e-01,
            1.28690942e+00, -1.20442879e+00, -3...0871e-01, -7.64560699e-01, -5.72143526e-02,
           -1.37658644e+00, -1.18460104e+00,  3.49999193e-01,  1.03889155e+00])
    leaves     = array([[ 6.,  2., 14., ..., 11., 15.,  2.],
           [12., 12., 14., ..., 18.,  7., 14.],
           [12.,  7., 14., ..., 11... 2.,  8., ..., 16.,  4.,  6.],
           [12., 11., 11., ...,  6.,  7., 14.],
           [12., 12., 11., ..., 16.,  7., 13.]])
    loss       = 'absolute_error'
    mse        = 0.061502134763447056
    ones       = array([1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
           1., 1., 1., 1., 1., 1., 1., 1., 1., ...1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
           1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.])
    reg        = GradientBoostingRegressor(learning_rate=0.5, loss='absolute_error', max_depth=4,
                              n_estimators=30, random_state=9, subsample=0.5)
    sample_weight = array([1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
           1., 1., 1., 1., 1., 1., 1., 1., 1., ...1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
           1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.])
    subsample  = 0.5
    y_pred     = array([ 0.70059485,  1.12371977,  1.19378893, -0.71641662,  1.30053896,
           -1.55576776, -0.35896728,  0.6208227 , ...940539,  1.00562572,  0.44547937, -0.70495051,
            0.02715904, -1.17364417, -1.1968037 ,  0.29633824,  1.22354559])
    
    �[1m�[31m/io/sklearn/ensemble/tests/test_gradient_boosting.py�[0m:172: AssertionError
    ----------------- generated xml file: /temp_dir/test-data.xml ------------------
    
    
  11. changed the title [-]⚠️ CI failed on Linux_Docker.debian_atlas_32bit (last failure: Jun 19, 2024) ⚠️[/-] [+]⚠️ CI failed on Linux_Docker.debian_atlas_32bit (last failure: Jul 03, 2024) ⚠️[/+] on Jul 3, 2024
  12. changed the title [-]⚠️ CI failed on Linux_Docker.debian_atlas_32bit (last failure: Jul 03, 2024) ⚠️[/-] [+]⚠️ CI failed on Linux_Docker.debian_atlas_32bit (last failure: Jul 20, 2024) ⚠️[/+] on Jul 20, 2024
  13. changed the title [-]⚠️ CI failed on Linux_Docker.debian_atlas_32bit (last failure: Jul 20, 2024) ⚠️[/-] [+]⚠️ CI failed on Linux_Docker.debian_atlas_32bit (last failure: Jul 30, 2024) ⚠️[/+] on Jul 30, 2024
  14. changed the title [-]⚠️ CI failed on Linux_Docker.debian_atlas_32bit (last failure: Jul 30, 2024) ⚠️[/-] [+]⚠️ CI failed on Linux_Docker.debian_atlas_32bit (last failure: Aug 07, 2024) ⚠️[/+] on Aug 7, 2024
  15. changed the title [-]⚠️ CI failed on Linux_Docker.debian_atlas_32bit (last failure: Aug 07, 2024) ⚠️[/-] [+]⚠️ CI failed on Linux_Docker.debian_atlas_32bit (last failure: Sep 01, 2024) ⚠️[/+] on Sep 1, 2024
  16. changed the title [-]⚠️ CI failed on Linux_Docker.debian_atlas_32bit (last failure: Sep 01, 2024) ⚠️[/-] [+]⚠️ CI failed on Linux_Docker.debian_atlas_32bit (last failure: Sep 02, 2024) ⚠️[/+] on Sep 2, 2024
  17. lesteve commented on Sep 2, 2024

    @lesteve
    Member

    The debian32 build has started to fail from time to time recently (also seen on PRs e.g. #29765, #29759 and #29724). No clue about the underlying reason and I did not manage to reproduce it inside a i386/debian:12 Docker image.

    FAILED cluster/tests/test_spectral.py::test_spectral_clustering_with_arpack_amg_solvers
    FAILED feature_extraction/tests/test_image.py::test_img_to_graph - IndexError...
    FAILED impute/tests/test_impute.py::test_imputation_mean_median[csc_matrix]
    FAILED impute/tests/test_impute.py::test_imputation_mean_median[csc_array] - ...
    FAILED preprocessing/tests/test_data.py::test_robust_scale_axis1 - IndexError...
    
    More details from build log
    _______________ test_spectral_clustering_with_arpack_amg_solvers _______________
    
        def test_spectral_clustering_with_arpack_amg_solvers():
            # Test that spectral_clustering is the same for arpack and amg solver
            # Based on toy example from plot_segmentation_toy.py
        
            # a small two coin image
            x, y = np.indices((40, 40))
        
            center1, center2 = (14, 12), (20, 25)
            radius1, radius2 = 8, 7
        
            circle1 = (x - center1[0]) ** 2 + (y - center1[1]) ** 2 < radius1**2
            circle2 = (x - center2[0]) ** 2 + (y - center2[1]) ** 2 < radius2**2
        
            circles = circle1 | circle2
            mask = circles.copy()
            img = circles.astype(float)
        
    >       graph = img_to_graph(img, mask=mask)
    
    center1    = (14, 12)
    center2    = (20, 25)
    circle1    = array([[False, False, False, ..., False, False, False],
           [False, False, False, ..., False, False, False],
          ...alse],
           [False, False, False, ..., False, False, False],
           [False, False, False, ..., False, False, False]])
    circle2    = array([[False, False, False, ..., False, False, False],
           [False, False, False, ..., False, False, False],
          ...alse],
           [False, False, False, ..., False, False, False],
           [False, False, False, ..., False, False, False]])
    circles    = array([[False, False, False, ..., False, False, False],
           [False, False, False, ..., False, False, False],
          ...alse],
           [False, False, False, ..., False, False, False],
           [False, False, False, ..., False, False, False]])
    img        = array([[0., 0., 0., ..., 0., 0., 0.],
           [0., 0., 0., ..., 0., 0., 0.],
           [0., 0., 0., ..., 0., 0., 0.],
           ...,
           [0., 0., 0., ..., 0., 0., 0.],
           [0., 0., 0., ..., 0., 0., 0.],
           [0., 0., 0., ..., 0., 0., 0.]])
    mask       = array([[False, False, False, ..., False, False, False],
           [False, False, False, ..., False, False, False],
          ...alse],
           [False, False, False, ..., False, False, False],
           [False, False, False, ..., False, False, False]])
    radius1    = 8
    radius2    = 7
    x          = array([[ 0,  0,  0, ...,  0,  0,  0],
           [ 1,  1,  1, ...,  1,  1,  1],
           [ 2,  2,  2, ...,  2,  2,  2],
           ...,
           [37, 37, 37, ..., 37, 37, 37],
           [38, 38, 38, ..., 38, 38, 38],
           [39, 39, 39, ..., 39, 39, 39]])
    y          = array([[ 0,  1,  2, ..., 37, 38, 39],
           [ 0,  1,  2, ..., 37, 38, 39],
           [ 0,  1,  2, ..., 37, 38, 39],
           ...,
           [ 0,  1,  2, ..., 37, 38, 39],
           [ 0,  1,  2, ..., 37, 38, 39],
           [ 0,  1,  2, ..., 37, 38, 39]])
    
    /io/sklearn/cluster/tests/test_spectral.py:235: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    /io/sklearn/utils/_param_validation.py:216: in wrapper
        return func(*args, **kwargs)
            args       = (array([[0., 0., 0., ..., 0., 0., 0.],
           [0., 0., 0., ..., 0., 0., 0.],
           [0., 0., 0., ..., 0., 0., 0.],
       ....,
           [0., 0., 0., ..., 0., 0., 0.],
           [0., 0., 0., ..., 0., 0., 0.],
           [0., 0., 0., ..., 0., 0., 0.]]),)
            func       = <function img_to_graph at 0xedb71758>
            func_sig   = <Signature (img, *, mask=None, return_as=<class 'scipy.sparse._coo.coo_matrix'>, dtype=None)>
            global_skip_validation = False
            kwargs     = {'mask': array([[False, False, False, ..., False, False, False],
           [False, False, False, ..., False, False, False...lse],
           [False, False, False, ..., False, False, False],
           [False, False, False, ..., False, False, False]])}
            parameter_constraints = {'dtype': 'no_validation', 'img': ['array-like'], 'mask': [None, <class 'numpy.ndarray'>], 'return_as': [<class 'type'>]}
            params     = {'dtype': None, 'img': array([[0., 0., 0., ..., 0., 0., 0.],
           [0., 0., 0., ..., 0., 0., 0.],
           [0., 0., 0.,... False],
           [False, False, False, ..., False, False, False]]), 'return_as': <class 'scipy.sparse._coo.coo_matrix'>}
            prefer_skip_nested_validation = True
            to_ignore  = ['self', 'cls']
    /io/sklearn/feature_extraction/image.py:185: in img_to_graph
        return _to_graph(n_x, n_y, n_z, mask, img, return_as, dtype)
            dtype      = None
            img        = array([[[0.],
            [0.],
            [0.],
            ...,
            [0.],
            [0.],
            [0.]],
    
           [[0.],
         ...0.],
            [0.]],
    
           [[0.],
            [0.],
            [0.],
            ...,
            [0.],
            [0.],
            [0.]]])
            mask       = array([[False, False, False, ..., False, False, False],
           [False, False, False, ..., False, False, False],
          ...alse],
           [False, False, False, ..., False, False, False],
           [False, False, False, ..., False, False, False]])
            n_x        = 40
            n_y        = 40
            n_z        = 1
            return_as  = <class 'scipy.sparse._coo.coo_matrix'>
    /io/sklearn/feature_extraction/image.py:103: in _to_graph
        weights = _compute_gradient_3d(edges, img)
            dtype      = dtype('float64')
            edges      = array([[   0,    1,    2, ..., 1557, 1558, 1559],
           [   1,    2,    3, ..., 1597, 1598, 1599]])
            img        = array([[[0.],
            [0.],
            [0.],
            ...,
            [0.],
            [0.],
            [0.]],
    
           [[0.],
         ...0.],
            [0.]],
    
           [[0.],
            [0.],
            [0.],
            ...,
            [0.],
            [0.],
            [0.]]])
            mask       = array([[False, False, False, ..., False, False, False],
           [False, False, False, ..., False, False, False],
          ...alse],
           [False, False, False, ..., False, False, False],
           [False, False, False, ..., False, False, False]])
            n_x        = 40
            n_y        = 40
            n_z        = 1
            return_as  = <class 'scipy.sparse._coo.coo_matrix'>
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    edges = array([[   0,    1,    2, ..., 1557, 1558, 1559],
           [   1,    2,    3, ..., 1597, 1598, 1599]])
    img = array([[[0.],
            [0.],
            [0.],
            ...,
            [0.],
            [0.],
            [0.]],
    
           [[0.],
         ...0.],
            [0.]],
    
           [[0.],
            [0.],
            [0.],
            ...,
            [0.],
            [0.],
            [0.]]])
    
        def _compute_gradient_3d(edges, img):
            _, n_y, n_z = img.shape
            gradient = np.abs(
    >           img[
                    edges[0] // (n_y * n_z),
                    (edges[0] % (n_y * n_z)) // n_z,
                    (edges[0] % (n_y * n_z)) % n_z,
                ]
                - img[
                    edges[1] // (n_y * n_z),
                    (edges[1] % (n_y * n_z)) // n_z,
                    (edges[1] % (n_y * n_z)) % n_z,
                ]
            )
    E       IndexError: index 40 is out of bounds for axis 0 with size 40
    
    _          = 40
    edges      = array([[   0,    1,    2, ..., 1557, 1558, 1559],
           [   1,    2,    3, ..., 1597, 1598, 1599]])
    img        = array([[[0.],
            [0.],
            [0.],
            ...,
            [0.],
            [0.],
            [0.]],
    
           [[0.],
         ...0.],
            [0.]],
    
           [[0.],
            [0.],
            [0.],
            ...,
            [0.],
            [0.],
            [0.]]])
    n_y        = 40
    n_z        = 1
    
    /io/sklearn/feature_extraction/image.py:52: IndexError
    ______________________________ test_img_to_graph _______________________________
    
        def test_img_to_graph():
            x, y = np.mgrid[:4, :4] - 10
    >       grad_x = img_to_graph(x)
    
    x          = array([[-10, -10, -10, -10],
           [ -9,  -9,  -9,  -9],
           [ -8,  -8,  -8,  -8],
           [ -7,  -7,  -7,  -7]])
    y          = array([[-10,  -9,  -8,  -7],
           [-10,  -9,  -8,  -7],
           [-10,  -9,  -8,  -7],
           [-10,  -9,  -8,  -7]])
    
    /io/sklearn/feature_extraction/tests/test_image.py:21: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    /io/sklearn/utils/_param_validation.py:216: in wrapper
        return func(*args, **kwargs)
            args       = (array([[-10, -10, -10, -10],
           [ -9,  -9,  -9,  -9],
           [ -8,  -8,  -8,  -8],
           [ -7,  -7,  -7,  -7]]),)
            func       = <function img_to_graph at 0xedb71758>
            func_sig   = <Signature (img, *, mask=None, return_as=<class 'scipy.sparse._coo.coo_matrix'>, dtype=None)>
            global_skip_validation = False
            kwargs     = {}
            parameter_constraints = {'dtype': 'no_validation', 'img': ['array-like'], 'mask': [None, <class 'numpy.ndarray'>], 'return_as': [<class 'type'>]}
            params     = {'dtype': None, 'img': array([[-10, -10, -10, -10],
           [ -9,  -9,  -9,  -9],
           [ -8,  -8,  -8,  -8],
           [ -7,  -7,  -7,  -7]]), 'mask': None, 'return_as': <class 'scipy.sparse._coo.coo_matrix'>}
            prefer_skip_nested_validation = True
            to_ignore  = ['self', 'cls']
    /io/sklearn/feature_extraction/image.py:185: in img_to_graph
        return _to_graph(n_x, n_y, n_z, mask, img, return_as, dtype)
            dtype      = None
            img        = array([[[-10],
            [-10],
            [-10],
            [-10]],
    
           [[ -9],
            [ -9],
            [ -9],
            [ -...   [[ -8],
            [ -8],
            [ -8],
            [ -8]],
    
           [[ -7],
            [ -7],
            [ -7],
            [ -7]]])
            mask       = None
            n_x        = 4
            n_y        = 4
            n_z        = 1
            return_as  = <class 'scipy.sparse._coo.coo_matrix'>
    /io/sklearn/feature_extraction/image.py:103: in _to_graph
        weights = _compute_gradient_3d(edges, img)
            dtype      = dtype('int32')
            edges      = array([[ 0,  1,  2,  4,  5,  6,  8,  9, 10, 12, 13, 14,  0,  1,  2,  3,
             4,  5,  6,  7,  8,  9, 10, 11],
           [ 1,  2,  3,  5,  6,  7,  9, 10, 11, 13, 14, 15,  4,  5,  6,  7,
             8,  9, 10, 11, 12, 13, 14, 15]])
            img        = array([[[-10],
            [-10],
            [-10],
            [-10]],
    
           [[ -9],
            [ -9],
            [ -9],
            [ -...   [[ -8],
            [ -8],
            [ -8],
            [ -8]],
    
           [[ -7],
            [ -7],
            [ -7],
            [ -7]]])
            mask       = None
            n_x        = 4
            n_y        = 4
            n_z        = 1
            return_as  = <class 'scipy.sparse._coo.coo_matrix'>
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    edges = array([[ 0,  1,  2,  4,  5,  6,  8,  9, 10, 12, 13, 14,  0,  1,  2,  3,
             4,  5,  6,  7,  8,  9, 10, 11],
           [ 1,  2,  3,  5,  6,  7,  9, 10, 11, 13, 14, 15,  4,  5,  6,  7,
             8,  9, 10, 11, 12, 13, 14, 15]])
    img = array([[[-10],
            [-10],
            [-10],
            [-10]],
    
           [[ -9],
            [ -9],
            [ -9],
            [ -...   [[ -8],
            [ -8],
            [ -8],
            [ -8]],
    
           [[ -7],
            [ -7],
            [ -7],
            [ -7]]])
    
        def _compute_gradient_3d(edges, img):
            _, n_y, n_z = img.shape
            gradient = np.abs(
    >           img[
                    edges[0] // (n_y * n_z),
                    (edges[0] % (n_y * n_z)) // n_z,
                    (edges[0] % (n_y * n_z)) % n_z,
                ]
                - img[
                    edges[1] // (n_y * n_z),
                    (edges[1] % (n_y * n_z)) // n_z,
                    (edges[1] % (n_y * n_z)) % n_z,
                ]
            )
    E       IndexError: index 4 is out of bounds for axis 0 with size 4
    
    _          = 4
    edges      = array([[ 0,  1,  2,  4,  5,  6,  8,  9, 10, 12, 13, 14,  0,  1,  2,  3,
             4,  5,  6,  7,  8,  9, 10, 11],
           [ 1,  2,  3,  5,  6,  7,  9, 10, 11, 13, 14, 15,  4,  5,  6,  7,
             8,  9, 10, 11, 12, 13, 14, 15]])
    img        = array([[[-10],
            [-10],
            [-10],
            [-10]],
    
           [[ -9],
            [ -9],
            [ -9],
            [ -...   [[ -8],
            [ -8],
            [ -8],
            [ -8]],
    
           [[ -7],
            [ -7],
            [ -7],
            [ -7]]])
    n_y        = 4
    n_z        = 1
    
    /io/sklearn/feature_extraction/image.py:52: IndexError
    ___________________ test_imputation_mean_median[csc_matrix] ____________________
    
    csc_container = <class 'scipy.sparse._csc.csc_matrix'>
    
        @pytest.mark.parametrize("csc_container", CSC_CONTAINERS)
        def test_imputation_mean_median(csc_container):
            # Test imputation using the mean and median strategies, when
            # missing_values != 0.
            rng = np.random.RandomState(0)
        
            dim = 10
            dec = 10
            shape = (dim * dim, dim + dec)
        
            zeros = np.zeros(shape[0])
            values = np.arange(1, shape[0] + 1)
            values[4::2] = -values[4::2]
        
            tests = [
                ("mean", np.nan, lambda z, v, p: safe_mean(np.hstack((z, v)))),
                ("median", np.nan, lambda z, v, p: safe_median(np.hstack((z, v)))),
            ]
        
            for strategy, test_missing_values, true_value_fun in tests:
                X = np.empty(shape)
                X_true = np.empty(shape)
                true_statistics = np.empty(shape[1])
        
                # Create a matrix X with columns
                #    - with only zeros,
                #    - with only missing values
                #    - with zeros, missing values and values
                # And a matrix X_true containing all true values
                for j in range(shape[1]):
                    nb_zeros = (j - dec + 1 > 0) * (j - dec + 1) * (j - dec + 1)
                    nb_missing_values = max(shape[0] + dec * dec - (j + dec) * (j + dec), 0)
                    nb_values = shape[0] - nb_zeros - nb_missing_values
        
                    z = zeros[:nb_zeros]
                    p = np.repeat(test_missing_values, nb_missing_values)
                    v = values[rng.permutation(len(values))[:nb_values]]
        
                    true_statistics[j] = true_value_fun(z, v, p)
        
                    # Create the columns
                    X[:, j] = np.hstack((v, z, p))
        
                    if 0 == test_missing_values:
                        # XXX unreached code as of v0.22
                        X_true[:, j] = np.hstack(
                            (v, np.repeat(true_statistics[j], nb_missing_values + nb_zeros))
                        )
                    else:
                        X_true[:, j] = np.hstack(
                            (v, z, np.repeat(true_statistics[j], nb_missing_values))
                        )
        
                    # Shuffle them the same way
                    np.random.RandomState(j).shuffle(X[:, j])
                    np.random.RandomState(j).shuffle(X_true[:, j])
        
                # Mean doesn't support columns containing NaNs, median does
                if strategy == "median":
                    cols_to_keep = ~np.isnan(X_true).any(axis=0)
                else:
                    cols_to_keep = ~np.isnan(X_true).all(axis=0)
        
                X_true = X_true[:, cols_to_keep]
        
    >           _check_statistics(
                    X, X_true, strategy, true_statistics, test_missing_values, csc_container
                )
    
    X          = array([[ nan,  nan,  nan, ...,   0.,   0.,   0.],
           [ nan,  nan,  96., ...,  64.,   0.,   0.],
           [ nan,  nan...  2.,   0.,   0.],
           [ nan, -97., -53., ...,  50.,   0.,   0.],
           [ nan,  nan, -29., ...,  86.,   0.,   0.]])
    X_true     = array([[ 40., -16.,  10., ...,   0.,   0.,   0.],
           [ 40.,  96.,  48., ...,  64.,   0.,   0.],
           [ 40., -16....  2.,   0.,   0.],
           [-97., -53., -67., ...,  50.,   0.,   0.],
           [ 40., -29.,  44., ...,  86.,   0.,   0.]])
    cols_to_keep = array([False,  True,  True,  True,  True,  True,  True,  True,  True,
            True,  True,  True,  True,  True,  True,  True,  True,  True,
            True,  True])
    csc_container = <class 'scipy.sparse._csc.csc_matrix'>
    dec        = 10
    dim        = 10
    j          = 19
    nb_missing_values = 0
    nb_values  = 0
    nb_zeros   = 100
    p          = array([], dtype=float64)
    rng        = RandomState(MT19937) at 0xE20EF628
    shape      = (100, 20)
    strategy   = 'median'
    test_missing_values = nan
    tests      = [('mean', nan, <function test_imputation_mean_median.<locals>.<lambda> at 0xe1dbc6b8>), ('median', nan, <function test_imputation_mean_median.<locals>.<lambda> at 0xe1dbc438>)]
    true_statistics = array([  nan,  40. , -16. ,  10. ,   3.5,   2.5,   2.5,   2.5,   2.5,
             2.5,   1.5,   0.5,   0. ,   0. ,   0. ,   0. ,   0. ,   0. ,
             0. ,   0. ])
    true_value_fun = <function test_imputation_mean_median.<locals>.<lambda> at 0xe1dbc438>
    v          = array([], dtype=int32)
    values     = array([  1,   2,   3,   4,  -5,   6,  -7,   8,  -9,  10, -11,  12, -13,
            14, -15,  16, -17,  18, -19,  20, -21,...  -79,  80, -81,  82, -83,  84, -85,  86, -87,  88, -89,  90, -91,
            92, -93,  94, -95,  96, -97,  98, -99, 100])
    z          = array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
           0., 0., 0., 0., 0., 0., 0., 0., 0., ...0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
           0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
    zeros      = array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
           0., 0., 0., 0., 0., 0., 0., 0., 0., ...0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
           0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
    
    /io/sklearn/impute/tests/test_impute.py:237: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    /io/sklearn/impute/tests/test_impute.py:73: in _check_statistics
        X_trans = imputer.fit(X).transform(X.copy())
            X          = array([[ nan,  nan,  nan, ...,   0.,   0.,   0.],
           [ nan,  nan,  96., ...,  64.,   0.,   0.],
           [ nan,  nan...  2.,   0.,   0.],
           [ nan, -97., -53., ...,  50.,   0.,   0.],
           [ nan,  nan, -29., ...,  86.,   0.,   0.]])
            X_true     = array([[ 40., -16.,  10., ...,   0.,   0.,   0.],
           [ 40.,  96.,  48., ...,  64.,   0.,   0.],
           [ 40., -16....  2.,   0.,   0.],
           [-97., -53., -67., ...,  50.,   0.,   0.],
           [ 40., -29.,  44., ...,  86.,   0.,   0.]])
            assert_ae  = <function assert_array_almost_equal at 0xf3621e88>
            err_msg    = 'Parameters: strategy = median, missing_values = nan, sparse = {0}'
            imputer    = SimpleImputer(strategy='median')
            missing_values = nan
            sparse_container = <class 'scipy.sparse._csc.csc_matrix'>
            statistics = array([  nan,  40. , -16. ,  10. ,   3.5,   2.5,   2.5,   2.5,   2.5,
             2.5,   1.5,   0.5,   0. ,   0. ,   0. ,   0. ,   0. ,   0. ,
             0. ,   0. ])
            strategy   = 'median'
    /io/sklearn/base.py:1514: in wrapper
        return fit_method(estimator, *args, **kwargs)
            args       = (array([[ nan,  nan,  nan, ...,   0.,   0.,   0.],
           [ nan,  nan,  96., ...,  64.,   0.,   0.],
           [ nan,  na...2.,   0.,   0.],
           [ nan, -97., -53., ...,  50.,   0.,   0.],
           [ nan,  nan, -29., ...,  86.,   0.,   0.]]),)
            estimator  = SimpleImputer(strategy='median')
            fit_method = <function SimpleImputer.fit at 0xea2e6168>
            global_skip_validation = False
            kwargs     = {}
            partial_fit_and_fitted = False
            prefer_skip_nested_validation = True
    /io/sklearn/impute/_base.py:437: in fit
        self.statistics_ = self._dense_fit(
            X          = array([[ nan,  nan,  nan, ...,   0.,   0.,   0.],
           [ nan,  nan,  96., ...,  64.,   0.,   0.],
           [ nan,  nan...  2.,   0.,   0.],
           [ nan, -97., -53., ...,  50.,   0.,   0.],
           [ nan,  nan, -29., ...,  86.,   0.,   0.]])
            fill_value = 0
            self       = SimpleImputer(strategy='median')
            y          = None
    /io/sklearn/impute/_base.py:506: in _dense_fit
        median_masked = np.ma.median(masked_X, axis=0)
            X          = array([[ nan,  nan,  nan, ...,   0.,   0.,   0.],
           [ nan,  nan,  96., ...,  64.,   0.,   0.],
           [ nan,  nan...  2.,   0.,   0.],
           [ nan, -97., -53., ...,  50.,   0.,   0.],
           [ nan,  nan, -29., ...,  86.,   0.,   0.]])
            __class__  = <class 'sklearn.impute._base.SimpleImputer'>
            fill_value = 0
            masked_X   = masked_array(
      data=[[--, --, --, ..., 0.0, 0.0, 0.0],
            [--, --, 96.0, ..., 64.0, 0.0, 0.0],
            [--, --, ... False, False, ..., False, False, False],
            [ True,  True, False, ..., False, False, False]],
      fill_value=1e+20)
            missing_mask = array([[ True,  True,  True, ..., False, False, False],
           [ True,  True, False, ..., False, False, False],
          ...alse],
           [ True, False, False, ..., False, False, False],
           [ True,  True, False, ..., False, False, False]])
            missing_values = nan
            self       = SimpleImputer(strategy='median')
            strategy   = 'median'
    /usr/lib/python3/dist-packages/numpy/ma/extras.py:735: in median
        return _ureduce(a, func=_median, keepdims=keepdims, axis=axis, out=out,
            a          = masked_array(
      data=[[--, --, --, ..., 0.0, 0.0, 0.0],
            [--, --, 96.0, ..., 64.0, 0.0, 0.0],
            [--, --, ... False, False, ..., False, False, False],
            [ True,  True, False, ..., False, False, False]],
      fill_value=1e+20)
            axis       = 0
            keepdims   = False
            out        = None
            overwrite_input = False
    /usr/lib/python3/dist-packages/numpy/lib/function_base.py:3752: in _ureduce
        r = func(a, **kwargs)
            a          = masked_array(
      data=[[--, --, --, ..., 0.0, 0.0, 0.0],
            [--, --, 96.0, ..., 64.0, 0.0, 0.0],
            [--, --, ... False, False, ..., False, False, False],
            [ True,  True, False, ..., False, False, False]],
      fill_value=1e+20)
            axis       = (0,)
            func       = <function _median at 0xf506b618>
            keepdims   = False
            kwargs     = {'axis': 0, 'out': None, 'overwrite_input': False}
            nd         = 2
            out        = None
    /usr/lib/python3/dist-packages/numpy/ma/extras.py:798: in _median
        low_high = np.take_along_axis(asorted, lh, axis=axis)
            a          = masked_array(
      data=[[--, --, --, ..., 0.0, 0.0, 0.0],
            [--, --, 96.0, ..., 64.0, 0.0, 0.0],
            [--, --, ... False, False, ..., False, False, False],
            [ True,  True, False, ..., False, False, False]],
      fill_value=1e+20)
            asorted    = masked_array(
      data=[[--, -97.0, -99.0, ..., -99.0, -79.0, 0.0],
            [--, -85.0, -91.0, ..., -91.0, -65.0, 0.0],
    ...  True,  True, ..., False, False, False],
            [ True,  True,  True, ..., False, False, False]],
      fill_value=1e+20)
            axis       = 0
            counts     = array([[  0,  21,  44,  69,  96, 100, 100, 100, 100, 100, 100, 100, 100,
            100, 100, 100, 100, 100, 100, 100]], dtype=int32)
            fill_value = inf
            h          = array([[  0,  21,  44,  69,  96, 100, 100, 100, 100, 100, 100, 100, 100,
            100, 100, 100,  50,  50,  50,  50]], dtype=int32)
            l          = array([[-1, 21, 43, 69, 95, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
            49, 49, 49, 49]])
            lh         = array([[ -1,  21,  43,  69,  95,  99,  99,  99,  99,  99,  99,  99,  99,
             99,  99,  99,  49,  49,  49,  49],
           [  0,  21,  44,  69,  96, 100, 100, 100, 100, 100, 100, 100, 100,
            100, 100, 100,  50,  50,  50,  50]])
            odd        = array([[False,  True, False,  True, False, False, False, False, False,
            False, False, False, False, False, False, False, False, False,
            False, False]])
            out        = None
            overwrite_input = False
    <__array_function__ internals>:200: in take_along_axis
        ???
            args       = (masked_array(
      data=[[--, -97.0, -99.0, ..., -99.0, -79.0, 0.0],
            [--, -85.0, -91.0, ..., -91.0, -65.0, 0.0],...
           [  0,  21,  44,  69,  96, 100, 100, 100, 100, 100, 100, 100, 100,
            100, 100, 100,  50,  50,  50,  50]]))
            dispatcher = <function _take_along_axis_dispatcher at 0xf5446118>
            implementation = <function take_along_axis at 0xf5446208>
            kwargs     = {'axis': 0}
            public_api = <function take_along_axis at 0xf5446258>
            relevant_args = (masked_array(
      data=[[--, -97.0, -99.0, ..., -99.0, -79.0, 0.0],
            [--, -85.0, -91.0, ..., -91.0, -65.0, 0.0],...
           [  0,  21,  44,  69,  96, 100, 100, 100, 100, 100, 100, 100, 100,
            100, 100, 100,  50,  50,  50,  50]]))
    /usr/lib/python3/dist-packages/numpy/lib/shape_base.py:170: in take_along_axis
        return arr[_make_along_axis_idx(arr_shape, indices, axis)]
            arr        = masked_array(
      data=[[--, -97.0, -99.0, ..., -99.0, -79.0, 0.0],
            [--, -85.0, -91.0, ..., -91.0, -65.0, 0.0],
    ...  True,  True, ..., False, False, False],
            [ True,  True,  True, ..., False, False, False]],
      fill_value=1e+20)
            arr_shape  = (100, 20)
            axis       = 0
            indices    = array([[ -1,  21,  43,  69,  95,  99,  99,  99,  99,  99,  99,  99,  99,
             99,  99,  99,  49,  49,  49,  49],
           [  0,  21,  44,  69,  96, 100, 100, 100, 100, 100, 100, 100, 100,
            100, 100, 100,  50,  50,  50,  50]])
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = masked_array(
      data=[[--, -97.0, -99.0, ..., -99.0, -79.0, 0.0],
            [--, -85.0, -91.0, ..., -91.0, -65.0, 0.0],
    ...  True,  True, ..., False, False, False],
            [ True,  True,  True, ..., False, False, False]],
      fill_value=1e+20)
    indx = (array([[ -1,  21,  43,  69,  95,  99,  99,  99,  99,  99,  99,  99,  99,
             99,  99,  99,  49,  49,  49,  49],
    ...0,  50,  50,  50]]), array([[ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
            16, 17, 18, 19]]))
    
        def __getitem__(self, indx):
            """
            x.__getitem__(y) <==> x[y]
        
            Return the item described by i, as a masked array.
        
            """
            # We could directly use ndarray.__getitem__ on self.
            # But then we would have to modify __array_finalize__ to prevent the
            # mask of being reshaped if it hasn't been set up properly yet
            # So it's easier to stick to the current version
    >       dout = self.data[indx]
    E       IndexError: index 100 is out of bounds for axis 0 with size 100
    
    indx       = (array([[ -1,  21,  43,  69,  95,  99,  99,  99,  99,  99,  99,  99,  99,
             99,  99,  99,  49,  49,  49,  49],
    ...0,  50,  50,  50]]), array([[ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
            16, 17, 18, 19]]))
    self       = masked_array(
      data=[[--, -97.0, -99.0, ..., -99.0, -79.0, 0.0],
            [--, -85.0, -91.0, ..., -91.0, -65.0, 0.0],
    ...  True,  True, ..., False, False, False],
            [ True,  True,  True, ..., False, False, False]],
      fill_value=1e+20)
    
    /usr/lib/python3/dist-packages/numpy/ma/core.py:3216: IndexError
    ____________________ test_imputation_mean_median[csc_array] ____________________
    
    csc_container = <class 'scipy.sparse._arrays.csc_array'>
    
        @pytest.mark.parametrize("csc_container", CSC_CONTAINERS)
        def test_imputation_mean_median(csc_container):
            # Test imputation using the mean and median strategies, when
            # missing_values != 0.
            rng = np.random.RandomState(0)
        
            dim = 10
            dec = 10
            shape = (dim * dim, dim + dec)
        
            zeros = np.zeros(shape[0])
            values = np.arange(1, shape[0] + 1)
            values[4::2] = -values[4::2]
        
            tests = [
                ("mean", np.nan, lambda z, v, p: safe_mean(np.hstack((z, v)))),
                ("median", np.nan, lambda z, v, p: safe_median(np.hstack((z, v)))),
            ]
        
            for strategy, test_missing_values, true_value_fun in tests:
                X = np.empty(shape)
                X_true = np.empty(shape)
                true_statistics = np.empty(shape[1])
        
                # Create a matrix X with columns
                #    - with only zeros,
                #    - with only missing values
                #    - with zeros, missing values and values
                # And a matrix X_true containing all true values
                for j in range(shape[1]):
                    nb_zeros = (j - dec + 1 > 0) * (j - dec + 1) * (j - dec + 1)
                    nb_missing_values = max(shape[0] + dec * dec - (j + dec) * (j + dec), 0)
                    nb_values = shape[0] - nb_zeros - nb_missing_values
        
                    z = zeros[:nb_zeros]
                    p = np.repeat(test_missing_values, nb_missing_values)
                    v = values[rng.permutation(len(values))[:nb_values]]
        
                    true_statistics[j] = true_value_fun(z, v, p)
        
                    # Create the columns
                    X[:, j] = np.hstack((v, z, p))
        
                    if 0 == test_missing_values:
                        # XXX unreached code as of v0.22
                        X_true[:, j] = np.hstack(
                            (v, np.repeat(true_statistics[j], nb_missing_values + nb_zeros))
                        )
                    else:
                        X_true[:, j] = np.hstack(
                            (v, z, np.repeat(true_statistics[j], nb_missing_values))
                        )
        
                    # Shuffle them the same way
                    np.random.RandomState(j).shuffle(X[:, j])
                    np.random.RandomState(j).shuffle(X_true[:, j])
        
                # Mean doesn't support columns containing NaNs, median does
                if strategy == "median":
                    cols_to_keep = ~np.isnan(X_true).any(axis=0)
                else:
                    cols_to_keep = ~np.isnan(X_true).all(axis=0)
        
                X_true = X_true[:, cols_to_keep]
        
    >           _check_statistics(
                    X, X_true, strategy, true_statistics, test_missing_values, csc_container
                )
    
    X          = array([[ nan,  nan,  nan, ...,   0.,   0.,   0.],
           [ nan,  nan,  96., ...,  64.,   0.,   0.],
           [ nan,  nan...  2.,   0.,   0.],
           [ nan, -97., -53., ...,  50.,   0.,   0.],
           [ nan,  nan, -29., ...,  86.,   0.,   0.]])
    X_true     = array([[ 40., -16.,  10., ...,   0.,   0.,   0.],
           [ 40.,  96.,  48., ...,  64.,   0.,   0.],
           [ 40., -16....  2.,   0.,   0.],
           [-97., -53., -67., ...,  50.,   0.,   0.],
           [ 40., -29.,  44., ...,  86.,   0.,   0.]])
    cols_to_keep = array([False,  True,  True,  True,  True,  True,  True,  True,  True,
            True,  True,  True,  True,  True,  True,  True,  True,  True,
            True,  True])
    csc_container = <class 'scipy.sparse._arrays.csc_array'>
    dec        = 10
    dim        = 10
    j          = 19
    nb_missing_values = 0
    nb_values  = 0
    nb_zeros   = 100
    p          = array([], dtype=float64)
    rng        = RandomState(MT19937) at 0xE20EF7A8
    shape      = (100, 20)
    strategy   = 'median'
    test_missing_values = nan
    tests      = [('mean', nan, <function test_imputation_mean_median.<locals>.<lambda> at 0xdf7470c8>), ('median', nan, <function test_imputation_mean_median.<locals>.<lambda> at 0xdf747118>)]
    true_statistics = array([  nan,  40. , -16. ,  10. ,   3.5,   2.5,   2.5,   2.5,   2.5,
             2.5,   1.5,   0.5,   0. ,   0. ,   0. ,   0. ,   0. ,   0. ,
             0. ,   0. ])
    true_value_fun = <function test_imputation_mean_median.<locals>.<lambda> at 0xdf747118>
    v          = array([], dtype=int32)
    values     = array([  1,   2,   3,   4,  -5,   6,  -7,   8,  -9,  10, -11,  12, -13,
            14, -15,  16, -17,  18, -19,  20, -21,...  -79,  80, -81,  82, -83,  84, -85,  86, -87,  88, -89,  90, -91,
            92, -93,  94, -95,  96, -97,  98, -99, 100])
    z          = array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
           0., 0., 0., 0., 0., 0., 0., 0., 0., ...0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
           0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
    zeros      = array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
           0., 0., 0., 0., 0., 0., 0., 0., 0., ...0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
           0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
    
    /io/sklearn/impute/tests/test_impute.py:237: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    /io/sklearn/impute/tests/test_impute.py:73: in _check_statistics
        X_trans = imputer.fit(X).transform(X.copy())
            X          = array([[ nan,  nan,  nan, ...,   0.,   0.,   0.],
           [ nan,  nan,  96., ...,  64.,   0.,   0.],
           [ nan,  nan...  2.,   0.,   0.],
           [ nan, -97., -53., ...,  50.,   0.,   0.],
           [ nan,  nan, -29., ...,  86.,   0.,   0.]])
            X_true     = array([[ 40., -16.,  10., ...,   0.,   0.,   0.],
           [ 40.,  96.,  48., ...,  64.,   0.,   0.],
           [ 40., -16....  2.,   0.,   0.],
           [-97., -53., -67., ...,  50.,   0.,   0.],
           [ 40., -29.,  44., ...,  86.,   0.,   0.]])
            assert_ae  = <function assert_array_almost_equal at 0xf3621e88>
            err_msg    = 'Parameters: strategy = median, missing_values = nan, sparse = {0}'
            imputer    = SimpleImputer(strategy='median')
            missing_values = nan
            sparse_container = <class 'scipy.sparse._arrays.csc_array'>
            statistics = array([  nan,  40. , -16. ,  10. ,   3.5,   2.5,   2.5,   2.5,   2.5,
             2.5,   1.5,   0.5,   0. ,   0. ,   0. ,   0. ,   0. ,   0. ,
             0. ,   0. ])
            strategy   = 'median'
    /io/sklearn/base.py:1514: in wrapper
        return fit_method(estimator, *args, **kwargs)
            args       = (array([[ nan,  nan,  nan, ...,   0.,   0.,   0.],
           [ nan,  nan,  96., ...,  64.,   0.,   0.],
           [ nan,  na...2.,   0.,   0.],
           [ nan, -97., -53., ...,  50.,   0.,   0.],
           [ nan,  nan, -29., ...,  86.,   0.,   0.]]),)
            estimator  = SimpleImputer(strategy='median')
            fit_method = <function SimpleImputer.fit at 0xea2e6168>
            global_skip_validation = False
            kwargs     = {}
            partial_fit_and_fitted = False
            prefer_skip_nested_validation = True
    /io/sklearn/impute/_base.py:437: in fit
        self.statistics_ = self._dense_fit(
            X          = array([[ nan,  nan,  nan, ...,   0.,   0.,   0.],
           [ nan,  nan,  96., ...,  64.,   0.,   0.],
           [ nan,  nan...  2.,   0.,   0.],
           [ nan, -97., -53., ...,  50.,   0.,   0.],
           [ nan,  nan, -29., ...,  86.,   0.,   0.]])
            fill_value = 0
            self       = SimpleImputer(strategy='median')
            y          = None
    /io/sklearn/impute/_base.py:506: in _dense_fit
        median_masked = np.ma.median(masked_X, axis=0)
            X          = array([[ nan,  nan,  nan, ...,   0.,   0.,   0.],
           [ nan,  nan,  96., ...,  64.,   0.,   0.],
           [ nan,  nan...  2.,   0.,   0.],
           [ nan, -97., -53., ...,  50.,   0.,   0.],
           [ nan,  nan, -29., ...,  86.,   0.,   0.]])
            __class__  = <class 'sklearn.impute._base.SimpleImputer'>
            fill_value = 0
            masked_X   = masked_array(
      data=[[--, --, --, ..., 0.0, 0.0, 0.0],
            [--, --, 96.0, ..., 64.0, 0.0, 0.0],
            [--, --, ... False, False, ..., False, False, False],
            [ True,  True, False, ..., False, False, False]],
      fill_value=1e+20)
            missing_mask = array([[ True,  True,  True, ..., False, False, False],
           [ True,  True, False, ..., False, False, False],
          ...alse],
           [ True, False, False, ..., False, False, False],
           [ True,  True, False, ..., False, False, False]])
            missing_values = nan
            self       = SimpleImputer(strategy='median')
            strategy   = 'median'
    /usr/lib/python3/dist-packages/numpy/ma/extras.py:735: in median
        return _ureduce(a, func=_median, keepdims=keepdims, axis=axis, out=out,
            a          = masked_array(
      data=[[--, --, --, ..., 0.0, 0.0, 0.0],
            [--, --, 96.0, ..., 64.0, 0.0, 0.0],
            [--, --, ... False, False, ..., False, False, False],
            [ True,  True, False, ..., False, False, False]],
      fill_value=1e+20)
            axis       = 0
            keepdims   = False
            out        = None
            overwrite_input = False
    /usr/lib/python3/dist-packages/numpy/lib/function_base.py:3752: in _ureduce
        r = func(a, **kwargs)
            a          = masked_array(
      data=[[--, --, --, ..., 0.0, 0.0, 0.0],
            [--, --, 96.0, ..., 64.0, 0.0, 0.0],
            [--, --, ... False, False, ..., False, False, False],
            [ True,  True, False, ..., False, False, False]],
      fill_value=1e+20)
            axis       = (0,)
            func       = <function _median at 0xf506b618>
            keepdims   = False
            kwargs     = {'axis': 0, 'out': None, 'overwrite_input': False}
            nd         = 2
            out        = None
    /usr/lib/python3/dist-packages/numpy/ma/extras.py:798: in _median
        low_high = np.take_along_axis(asorted, lh, axis=axis)
            a          = masked_array(
      data=[[--, --, --, ..., 0.0, 0.0, 0.0],
            [--, --, 96.0, ..., 64.0, 0.0, 0.0],
            [--, --, ... False, False, ..., False, False, False],
            [ True,  True, False, ..., False, False, False]],
      fill_value=1e+20)
            asorted    = masked_array(
      data=[[--, -97.0, -99.0, ..., -99.0, -79.0, 0.0],
            [--, -85.0, -91.0, ..., -91.0, -65.0, 0.0],
    ...  True,  True, ..., False, False, False],
            [ True,  True,  True, ..., False, False, False]],
      fill_value=1e+20)
            axis       = 0
            counts     = array([[  0,  21,  44,  69,  96, 100, 100, 100, 100, 100, 100, 100, 100,
            100, 100, 100, 100, 100, 100, 100]], dtype=int32)
            fill_value = inf
            h          = array([[  0,  21,  44,  69,  96, 100, 100, 100, 100, 100, 100, 100, 100,
            100, 100, 100,  50,  50,  50,  50]], dtype=int32)
            l          = array([[-1, 21, 43, 69, 95, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
            49, 49, 49, 49]])
            lh         = array([[ -1,  21,  43,  69,  95,  99,  99,  99,  99,  99,  99,  99,  99,
             99,  99,  99,  49,  49,  49,  49],
           [  0,  21,  44,  69,  96, 100, 100, 100, 100, 100, 100, 100, 100,
            100, 100, 100,  50,  50,  50,  50]])
            odd        = array([[False,  True, False,  True, False, False, False, False, False,
            False, False, False, False, False, False, False, False, False,
            False, False]])
            out        = None
            overwrite_input = False
    <__array_function__ internals>:200: in take_along_axis
        ???
            args       = (masked_array(
      data=[[--, -97.0, -99.0, ..., -99.0, -79.0, 0.0],
            [--, -85.0, -91.0, ..., -91.0, -65.0, 0.0],...
           [  0,  21,  44,  69,  96, 100, 100, 100, 100, 100, 100, 100, 100,
            100, 100, 100,  50,  50,  50,  50]]))
            dispatcher = <function _take_along_axis_dispatcher at 0xf5446118>
            implementation = <function take_along_axis at 0xf5446208>
            kwargs     = {'axis': 0}
            public_api = <function take_along_axis at 0xf5446258>
            relevant_args = (masked_array(
      data=[[--, -97.0, -99.0, ..., -99.0, -79.0, 0.0],
            [--, -85.0, -91.0, ..., -91.0, -65.0, 0.0],...
           [  0,  21,  44,  69,  96, 100, 100, 100, 100, 100, 100, 100, 100,
            100, 100, 100,  50,  50,  50,  50]]))
    /usr/lib/python3/dist-packages/numpy/lib/shape_base.py:170: in take_along_axis
        return arr[_make_along_axis_idx(arr_shape, indices, axis)]
            arr        = masked_array(
      data=[[--, -97.0, -99.0, ..., -99.0, -79.0, 0.0],
            [--, -85.0, -91.0, ..., -91.0, -65.0, 0.0],
    ...  True,  True, ..., False, False, False],
            [ True,  True,  True, ..., False, False, False]],
      fill_value=1e+20)
            arr_shape  = (100, 20)
            axis       = 0
            indices    = array([[ -1,  21,  43,  69,  95,  99,  99,  99,  99,  99,  99,  99,  99,
             99,  99,  99,  49,  49,  49,  49],
           [  0,  21,  44,  69,  96, 100, 100, 100, 100, 100, 100, 100, 100,
            100, 100, 100,  50,  50,  50,  50]])
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = masked_array(
      data=[[--, -97.0, -99.0, ..., -99.0, -79.0, 0.0],
            [--, -85.0, -91.0, ..., -91.0, -65.0, 0.0],
    ...  True,  True, ..., False, False, False],
            [ True,  True,  True, ..., False, False, False]],
      fill_value=1e+20)
    indx = (array([[ -1,  21,  43,  69,  95,  99,  99,  99,  99,  99,  99,  99,  99,
             99,  99,  99,  49,  49,  49,  49],
    ...0,  50,  50,  50]]), array([[ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
            16, 17, 18, 19]]))
    
        def __getitem__(self, indx):
            """
            x.__getitem__(y) <==> x[y]
        
            Return the item described by i, as a masked array.
        
            """
            # We could directly use ndarray.__getitem__ on self.
            # But then we would have to modify __array_finalize__ to prevent the
            # mask of being reshaped if it hasn't been set up properly yet
            # So it's easier to stick to the current version
    >       dout = self.data[indx]
    E       IndexError: index 100 is out of bounds for axis 0 with size 100
    
    indx       = (array([[ -1,  21,  43,  69,  95,  99,  99,  99,  99,  99,  99,  99,  99,
             99,  99,  99,  49,  49,  49,  49],
    ...0,  50,  50,  50]]), array([[ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
            16, 17, 18, 19]]))
    self       = masked_array(
      data=[[--, -97.0, -99.0, ..., -99.0, -79.0, 0.0],
            [--, -85.0, -91.0, ..., -91.0, -65.0, 0.0],
    ...  True,  True, ..., False, False, False],
            [ True,  True,  True, ..., False, False, False]],
      fill_value=1e+20)
    
    /usr/lib/python3/dist-packages/numpy/ma/core.py:3216: IndexError
    ___________________________ test_robust_scale_axis1 ____________________________
    
        def test_robust_scale_axis1():
            X = iris.data
    >       X_trans = robust_scale(X, axis=1)
    
    X          = array([[5.1, 3.5, 1.4, 0.2],
           [4.9, 3. , 1.4, 0.2],
           [4.7, 3.2, 1.3, 0.2],
           [4.6, 3.1, 1.5, 0.2],
      ...],
           [6.3, 2.5, 5. , 1.9],
           [6.5, 3. , 5.2, 2. ],
           [6.2, 3.4, 5.4, 2.3],
           [5.9, 3. , 5.1, 1.8]])
    
    /io/sklearn/preprocessing/tests/test_data.py:1580: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    /io/sklearn/utils/_param_validation.py:216: in wrapper
        return func(*args, **kwargs)
            args       = (array([[5.1, 3.5, 1.4, 0.2],
           [4.9, 3. , 1.4, 0.2],
           [4.7, 3.2, 1.3, 0.2],
           [4.6, 3.1, 1.5, 0.2],
     ...
           [6.3, 2.5, 5. , 1.9],
           [6.5, 3. , 5.2, 2. ],
           [6.2, 3.4, 5.4, 2.3],
           [5.9, 3. , 5.1, 1.8]]),)
            func       = <function robust_scale at 0xeddd1618>
            func_sig   = <Signature (X, *, axis=0, with_centering=True, with_scaling=True, quantile_range=(25.0, 75.0), copy=True, unit_variance=False)>
            global_skip_validation = False
            kwargs     = {'axis': 1}
            parameter_constraints = {'X': ['array-like', 'sparse matrix'], 'axis': [<sklearn.utils._param_validation.Options object at 0xf4107330>]}
            params     = {'X': array([[5.1, 3.5, 1.4, 0.2],
           [4.9, 3. , 1.4, 0.2],
           [4.7, 3.2, 1.3, 0.2],
           [4.6, 3.1, 1.5, 0....     [6.2, 3.4, 5.4, 2.3],
           [5.9, 3. , 5.1, 1.8]]), 'axis': 1, 'copy': True, 'quantile_range': (25.0, 75.0), ...}
            prefer_skip_nested_validation = False
            to_ignore  = ['self', 'cls']
    /io/sklearn/preprocessing/_data.py:1846: in robust_scale
        X = s.fit_transform(X.T).T
            X          = array([[5.1, 3.5, 1.4, 0.2],
           [4.9, 3. , 1.4, 0.2],
           [4.7, 3.2, 1.3, 0.2],
           [4.6, 3.1, 1.5, 0.2],
      ...],
           [6.3, 2.5, 5. , 1.9],
           [6.5, 3. , 5.2, 2. ],
           [6.2, 3.4, 5.4, 2.3],
           [5.9, 3. , 5.1, 1.8]])
            axis       = 1
            copy       = True
            original_ndim = 2
            quantile_range = (25.0, 75.0)
            s          = RobustScaler()
            unit_variance = False
            with_centering = True
            with_scaling = True
    /io/sklearn/utils/_set_output.py:319: in wrapped
        data_to_wrap = f(self, X, *args, **kwargs)
            X          = array([[5.1, 4.9, 4.7, 4.6, 5. , 5.4, 4.6, 5. , 4.4, 4.9, 5.4, 4.8, 4.8,
            4.3, 5.8, 5.7, 5.4, 5.1, 5.7, 5.1, 5....,
            1.9, 2. , 2.2, 1.5, 1.4, 2.3, 2.4, 1.8, 1.8, 2.1, 2.4, 2.3, 1.9,
            2.3, 2.5, 2.3, 1.9, 2. , 2.3, 1.8]])
            args       = ()
            f          = <function TransformerMixin.fit_transform at 0xee1378e8>
            kwargs     = {}
            method     = 'transform'
            self       = RobustScaler()
    /io/sklearn/base.py:1098: in fit_transform
        return self.fit(X, **fit_params).transform(X)
            X          = array([[5.1, 4.9, 4.7, 4.6, 5. , 5.4, 4.6, 5. , 4.4, 4.9, 5.4, 4.8, 4.8,
            4.3, 5.8, 5.7, 5.4, 5.1, 5.7, 5.1, 5....,
            1.9, 2. , 2.2, 1.5, 1.4, 2.3, 2.4, 1.8, 1.8, 2.1, 2.4, 2.3, 1.9,
            2.3, 2.5, 2.3, 1.9, 2. , 2.3, 1.8]])
            fit_params = {}
            self       = RobustScaler()
            y          = None
    /io/sklearn/base.py:1514: in wrapper
        return fit_method(estimator, *args, **kwargs)
            args       = (array([[5.1, 4.9, 4.7, 4.6, 5. , 5.4, 4.6, 5. , 4.4, 4.9, 5.4, 4.8, 4.8,
            4.3, 5.8, 5.7, 5.4, 5.1, 5.7, 5.1, 5...        1.9, 2. , 2.2, 1.5, 1.4, 2.3, 2.4, 1.8, 1.8, 2.1, 2.4, 2.3, 1.9,
            2.3, 2.5, 2.3, 1.9, 2. , 2.3, 1.8]]),)
            estimator  = RobustScaler()
            fit_method = <function RobustScaler.fit at 0xeddd14d8>
            global_skip_validation = False
            kwargs     = {}
            partial_fit_and_fitted = False
            prefer_skip_nested_validation = True
    /io/sklearn/preprocessing/_data.py:1612: in fit
        self.center_ = np.nanmedian(X, axis=0)
            X          = array([[5.1, 4.9, 4.7, 4.6, 5. , 5.4, 4.6, 5. , 4.4, 4.9, 5.4, 4.8, 4.8,
            4.3, 5.8, 5.7, 5.4, 5.1, 5.7, 5.1, 5....,
            1.9, 2. , 2.2, 1.5, 1.4, 2.3, 2.4, 1.8, 1.8, 2.1, 2.4, 2.3, 1.9,
            2.3, 2.5, 2.3, 1.9, 2. , 2.3, 1.8]])
            q_max      = 75.0
            q_min      = 25.0
            self       = RobustScaler()
            y          = None
    <__array_function__ internals>:200: in nanmedian
        ???
            args       = (array([[5.1, 4.9, 4.7, 4.6, 5. , 5.4, 4.6, 5. , 4.4, 4.9, 5.4, 4.8, 4.8,
            4.3, 5.8, 5.7, 5.4, 5.1, 5.7, 5.1, 5...        1.9, 2. , 2.2, 1.5, 1.4, 2.3, 2.4, 1.8, 1.8, 2.1, 2.4, 2.3, 1.9,
            2.3, 2.5, 2.3, 1.9, 2. , 2.3, 1.8]]),)
            dispatcher = <function _nanmedian_dispatcher at 0xf543c618>
            implementation = <function nanmedian at 0xf543c6b8>
            kwargs     = {'axis': 0}
            public_api = <function nanmedian at 0xf543c708>
            relevant_args = (array([[5.1, 4.9, 4.7, 4.6, 5. , 5.4, 4.6, 5. , 4.4, 4.9, 5.4, 4.8, 4.8,
            4.3, 5.8, 5.7, 5.4, 5.1, 5.7, 5.1, 5...   1.9, 2. , 2.2, 1.5, 1.4, 2.3, 2.4, 1.8, 1.8, 2.1, 2.4, 2.3, 1.9,
            2.3, 2.5, 2.3, 1.9, 2. , 2.3, 1.8]]), None)
    /usr/lib/python3/dist-packages/numpy/lib/nanfunctions.py:1217: in nanmedian
        return function_base._ureduce(a, func=_nanmedian, keepdims=keepdims,
            a          = array([[5.1, 4.9, 4.7, 4.6, 5. , 5.4, 4.6, 5. , 4.4, 4.9, 5.4, 4.8, 4.8,
            4.3, 5.8, 5.7, 5.4, 5.1, 5.7, 5.1, 5....,
            1.9, 2. , 2.2, 1.5, 1.4, 2.3, 2.4, 1.8, 1.8, 2.1, 2.4, 2.3, 1.9,
            2.3, 2.5, 2.3, 1.9, 2. , 2.3, 1.8]])
            axis       = 0
            keepdims   = <no value>
            out        = None
            overwrite_input = False
    /usr/lib/python3/dist-packages/numpy/lib/function_base.py:3752: in _ureduce
        r = func(a, **kwargs)
            a          = array([[5.1, 4.9, 4.7, 4.6, 5. , 5.4, 4.6, 5. , 4.4, 4.9, 5.4, 4.8, 4.8,
            4.3, 5.8, 5.7, 5.4, 5.1, 5.7, 5.1, 5....,
            1.9, 2. , 2.2, 1.5, 1.4, 2.3, 2.4, 1.8, 1.8, 2.1, 2.4, 2.3, 1.9,
            2.3, 2.5, 2.3, 1.9, 2. , 2.3, 1.8]])
            axis       = (0,)
            func       = <function _nanmedian at 0xf543c578>
            keepdims   = False
            kwargs     = {'axis': 0, 'out': None, 'overwrite_input': False}
            nd         = 2
            out        = None
    /usr/lib/python3/dist-packages/numpy/lib/nanfunctions.py:1094: in _nanmedian
        return _nanmedian_small(a, axis, out, overwrite_input)
            a          = array([[5.1, 4.9, 4.7, 4.6, 5. , 5.4, 4.6, 5. , 4.4, 4.9, 5.4, 4.8, 4.8,
            4.3, 5.8, 5.7, 5.4, 5.1, 5.7, 5.1, 5....,
            1.9, 2. , 2.2, 1.5, 1.4, 2.3, 2.4, 1.8, 1.8, 2.1, 2.4, 2.3, 1.9,
            2.3, 2.5, 2.3, 1.9, 2. , 2.3, 1.8]])
            axis       = 0
            out        = None
            overwrite_input = False
    /usr/lib/python3/dist-packages/numpy/lib/nanfunctions.py:1109: in _nanmedian_small
        m = np.ma.median(a, axis=axis, overwrite_input=overwrite_input)
            a          = masked_array(
      data=[[5.1, 4.9, 4.7, 4.6, 5.0, 5.4, 4.6, 5.0, 4.4, 4.9, 5.4, 4.8, 4.8,
             4.3, 5.8, 5.7, 5.4, 5...lse, False, False, False, False, False, False,
             False, False, False, False, False, False]],
      fill_value=1e+20)
            axis       = 0
            out        = None
            overwrite_input = False
    /usr/lib/python3/dist-packages/numpy/ma/extras.py:735: in median
        return _ureduce(a, func=_median, keepdims=keepdims, axis=axis, out=out,
            a          = masked_array(
      data=[[5.1, 4.9, 4.7, 4.6, 5.0, 5.4, 4.6, 5.0, 4.4, 4.9, 5.4, 4.8, 4.8,
             4.3, 5.8, 5.7, 5.4, 5...lse, False, False, False, False, False, False,
             False, False, False, False, False, False]],
      fill_value=1e+20)
            axis       = 0
            keepdims   = False
            out        = None
            overwrite_input = False
    /usr/lib/python3/dist-packages/numpy/lib/function_base.py:3752: in _ureduce
        r = func(a, **kwargs)
            a          = masked_array(
      data=[[5.1, 4.9, 4.7, 4.6, 5.0, 5.4, 4.6, 5.0, 4.4, 4.9, 5.4, 4.8, 4.8,
             4.3, 5.8, 5.7, 5.4, 5...lse, False, False, False, False, False, False,
             False, False, False, False, False, False]],
      fill_value=1e+20)
            axis       = (0,)
            func       = <function _median at 0xf506b618>
            keepdims   = False
            kwargs     = {'axis': 0, 'out': None, 'overwrite_input': False}
            nd         = 2
            out        = None
    /usr/lib/python3/dist-packages/numpy/ma/extras.py:798: in _median
        low_high = np.take_along_axis(asorted, lh, axis=axis)
            a          = masked_array(
      data=[[5.1, 4.9, 4.7, 4.6, 5.0, 5.4, 4.6, 5.0, 4.4, 4.9, 5.4, 4.8, 4.8,
             4.3, 5.8, 5.7, 5.4, 5...lse, False, False, False, False, False, False,
             False, False, False, False, False, False]],
      fill_value=1e+20)
            asorted    = masked_array(
      data=[[0.2, 0.2, 0.2, 0.2, 0.2, 0.4, 0.3, 0.2, 0.2, 0.1, 0.2, 0.2, 0.1,
             0.1, 0.2, 0.4, 0.4, 0...lse, False, False, False, False, False, False,
             False, False, False, False, False, False]],
      fill_value=1e+20)
            axis       = 0
            counts     = array([[4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
            4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, ... 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
            4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4]],
          dtype=int32)
            fill_value = inf
            h          = array([[4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
            4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, ... 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
            4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2]],
          dtype=int32)
            l          = array([[3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
            3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, ..., 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
            3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1]])
            lh         = array([[3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
            3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, ..., 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
            4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2]])
            odd        = array([[False, False, False, False, False, False, False, False, False,
            False, False, False, False, False, Fals...     False, False, False, False, False, False, False, False, False,
            False, False, False, False, False, False]])
            out        = None
            overwrite_input = False
    <__array_function__ internals>:200: in take_along_axis
        ???
            args       = (masked_array(
      data=[[0.2, 0.2, 0.2, 0.2, 0.2, 0.4, 0.3, 0.2, 0.2, 0.1, 0.2, 0.2, 0.1,
             0.1, 0.2, 0.4, 0.4, ... 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
            4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2]]))
            dispatcher = <function _take_along_axis_dispatcher at 0xf5446118>
            implementation = <function take_along_axis at 0xf5446208>
            kwargs     = {'axis': 0}
            public_api = <function take_along_axis at 0xf5446258>
            relevant_args = (masked_array(
      data=[[0.2, 0.2, 0.2, 0.2, 0.2, 0.4, 0.3, 0.2, 0.2, 0.1, 0.2, 0.2, 0.1,
             0.1, 0.2, 0.4, 0.4, ... 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
            4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2]]))
    /usr/lib/python3/dist-packages/numpy/lib/shape_base.py:170: in take_along_axis
        return arr[_make_along_axis_idx(arr_shape, indices, axis)]
            arr        = masked_array(
      data=[[0.2, 0.2, 0.2, 0.2, 0.2, 0.4, 0.3, 0.2, 0.2, 0.1, 0.2, 0.2, 0.1,
             0.1, 0.2, 0.4, 0.4, 0...lse, False, False, False, False, False, False,
             False, False, False, False, False, False]],
      fill_value=1e+20)
            arr_shape  = (4, 150)
            axis       = 0
            indices    = array([[3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
            3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, ..., 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
            4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2]])
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = masked_array(
      data=[[0.2, 0.2, 0.2, 0.2, 0.2, 0.4, 0.3, 0.2, 0.2, 0.1, 0.2, 0.2, 0.1,
             0.1, 0.2, 0.4, 0.4, 0...lse, False, False, False, False, False, False,
             False, False, False, False, False, False]],
      fill_value=1e+20)
    indx = (array([[3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
            3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,...
            130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,
            143, 144, 145, 146, 147, 148, 149]]))
    
        def __getitem__(self, indx):
            """
            x.__getitem__(y) <==> x[y]
        
            Return the item described by i, as a masked array.
        
            """
            # We could directly use ndarray.__getitem__ on self.
            # But then we would have to modify __array_finalize__ to prevent the
            # mask of being reshaped if it hasn't been set up properly yet
            # So it's easier to stick to the current version
    >       dout = self.data[indx]
    E       IndexError: index 4 is out of bounds for axis 0 with size 4
    
    indx       = (array([[3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
            3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,...
            130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,
            143, 144, 145, 146, 147, 148, 149]]))
    self       = masked_array(
      data=[[0.2, 0.2, 0.2, 0.2, 0.2, 0.4, 0.3, 0.2, 0.2, 0.1, 0.2, 0.2, 0.1,
             0.1, 0.2, 0.4, 0.4, 0...lse, False, False, False, False, False, False,
             False, False, False, False, False, False]],
      fill_value=1e+20)
    
    /usr/lib/python3/dist-packages/numpy/ma/core.py:3216: IndexError
    
    
  18. ogrisel commented on Sep 2, 2024

    @ogrisel
    Member

    Those 4 tests fail because of an out of bounds integer IndexError.

    I confirm I cannot reproduce in a local docker container where I installed the same version of the system packages (python3-numpy 1.24.2 in particular) and the other python packages from todays' lock file.

  19. changed the title [-]⚠️ CI failed on Linux_Docker.debian_atlas_32bit (last failure: Sep 02, 2024) ⚠️[/-] [+]⚠️ CI failed on Linux_Docker.debian_atlas_32bit (last failure: Sep 03, 2024) ⚠️[/+] on Sep 3, 2024
  20. lesteve commented on Sep 4, 2024

    @lesteve
    Member

    #29771 has fixed the IndexError issues and changed the build name debian_atlas_32bit => debian_32bit. I am going to close this one since some historical global_random_seed may be due to Atlas. A new issue will be automatically open when/if similar global_random_seed failures happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions