float has no attribute dtype...
@@ -323,7 +323,7 @@ def test_imputation_most_frequent_pandas(dtype):
@pytest.mark.parametrize("X_data, missing_value", [(1, 0), (1., np.nan)])
def test_imputation_constant_error_invalid_type(X_data, missing_value):
# Verify that exceptions are raised on invalid fill_value type
- X = np.full((3, 5), X_data, dtype=X_data.dtype)
+ X = np.full((3, 5), X_data, dtype=float)
X[0, 0] = missing_value
with pytest.raises(ValueError, match="imputing numerical"):
