Skip to content

Commit e8048b9

Browse files
committed
address comment for PR #40969
1 parent e489742 commit e8048b9

File tree

2 files changed

+4
-21
lines changed

2 files changed

+4
-21
lines changed

doc/source/whatsnew/v1.3.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ Conversion
695695
- Bug in :class:`Index` construction silently ignoring a passed ``dtype`` when the data cannot be cast to that dtype (:issue:`21311`)
696696
- Bug in :meth:`StringArray.astype` falling back to numpy and raising when converting to ``dtype='categorical'`` (:issue:`40450`)
697697
- Bug in :class:`DataFrame` construction with a dictionary containing an arraylike with ``ExtensionDtype`` and ``copy=True`` failing to make a copy (:issue:`38939`)
698-
- Bug in :func:`_coerce_to_type` failing to convert ``Float64DType`` input into numpy array (:issue:`40730`)
698+
- Bug in :meth:`qcut` raising error when taking ``Float64DType`` as input (:issue:`40730`)
699699

700700
Strings
701701
^^^^^^^

pandas/tests/reshape/test_qcut.py

+3-20
Original file line numberDiff line numberDiff line change
@@ -293,30 +293,13 @@ def test_qcut_bool_coercion_to_int(bins, box, compare):
293293

294294

295295
@pytest.mark.parametrize("q", [2, 5, 10])
296-
def test_qcut_nullable_integer(q, any_nullable_int_dtype):
297-
arr = pd.array(np.arange(100), dtype=any_nullable_int_dtype)
296+
def test_qcut_nullable_integer(q, any_nullable_numeric_dtype):
297+
arr = pd.array(np.arange(100), dtype=any_nullable_numeric_dtype)
298298
arr[::2] = pd.NA
299299

300300
result = qcut(arr, q)
301301
expected = qcut(arr.astype(float), q)
302302

303303
tm.assert_categorical_equal(result, expected)
304304

305-
306-
@pytest.mark.parametrize(
307-
"Data_type,Data_type_string",
308-
[
309-
(pd.Float64Dtype(),"Float64Dtype"),
310-
(pd.Int64Dtype(),"Int64Dtype")
311-
]
312-
)
313-
def test_qcut_numeric_dtype(Data_type,Data_type_string):
314-
series = pd.Series([1.0, 2.0, 3.0, 4.0], dtype=Data_type)
315-
316-
try:
317-
pd.qcut(series,2)
318-
except:
319-
Fail_string = Data_type_string + " is not supported"
320-
pytest.fail( msg = Fail_string )
321-
322-
305+

0 commit comments

Comments
 (0)